System.Xml
PowerShell primarily uses the System.Xml.XmlDocument type to work with XML content. This type is part of the System.Xml namespace. The documentation for the types available in this namespace is available in the .NET reference: https://learn.microsoft.com/en-gb/dotnet/api/system.xml.
The System.Xml.XmlDocument type is normally used via a type accelerator, [Xml].
The XML type accelerator
The XML type accelerator can be used to create instances of XmlDocument, as shown in the following code:
[Xml]$xml = @"
<?xml version="1.0"?>
<cars>
<car type="Saloon">
<colour>Green</colour>
<doors>4</doors>
<transmission>Automatic</transmission>
<engine>
<size>2.0</size>
<cylinders>4</cylinders>
</engine>
</car>
</cars>
"@
Elements and attributes of an XmlDocument object may be accessed...