Powershell: Convert XML to String July 30, 2023 by Tarik You are probably looking for OuterXml. $xml.OuterXml should give you what you want.