my xml DATA IS like:(This is xmlstring not an xmlfile and i need to transform without saving….)
<ProductGroups>
<ProductGroup>
<Name>ABC</Name>
<Id>123</Id>
</ProductGroup>
<ProductGroup>
<Name >xyz</Name>
<Id>456</Id>
</ProductGroup>
<ProductGroup>
<Name>PQR</Name>
<Id>789</Id>
</ProductGroup>
.
.
</ProductGroups>
I want to transform like this
<PRODUCTGROUPS>
<Name ID="123"> ABC</NAME>
<Name ID="456"> XYZ</NAME>
<Name ID="789">PQR</NAME>
.
.
</PRODUCTGROUPS>
I’m using C# with .NET.
From memory, may contain some errors: