How would I go about wrapping all the child elements of my root? Example of what I currently have:
<?xml version="1.0" encoding="utf-16"?>
<root>
<element>YUP</element>
<element>YUP</element>
<element>YUP</element>
</root>
But I need it to add a new child that encapsulates all those children of the root like so:
<?xml version="1.0" encoding="utf-16"?>
<root>
<newsubroot>
<element>YUP</element>
<element>YUP</element>
<element>YUP</element>
</newsubroot>
</root>
I don't have a preferred (or mandatory) technology - any example using both XmlDocument
or XDocument
is welcome.