 <p>There's no built-in way to do that, you'd have to generate the XML yourself. That said, there are two cmdlets in PowerShell that creates an XML-based representation of an object: <code>Export-CliXml</code> and <code>ConvertTo-Xml</code>. Check the help for more information.</p>