<company>
<stuff>
</stuff>
<machines>
<machine>
<name>ca</name>
<b>123</b>
<c>123</c>
</machine>
<machine>
<name>ad</name>
<b>234</b>
<c>234</c>
</machine>
<machine>
<name>be</name>
<b>345</b>
<c>345</c>
</machine>
</machines>
<otherstuff>
</otherstuff>
</company>
[xml]$xml = (get-content Company.xml)
[XmlNode]$orig = $xml.Company.Machines
[XmlNode]$new = ($orig.Machine | sort Name )
$xml.Company.ReplaceChild($new, $orig)