Powershell: Convert XML to String
How are you creating the XML object?
Typically, if you want an XML string from an object, you'd use:
$object | ConvertTo-Xml -As String
You are probably looking for OuterXml
.
$xml.OuterXml
should give you what you want.