I trying to find an "elegant way" to add/modify some XML Elements in the XML produced from the DataTable.WriteXML
<?xml version="1.0" standalone="yes"?>
<DocumentElement>
<Documents>
<XMLelement1>Value1</XMLelement1>
<XMLelement2>Value2</XMLelement2>
<XMLelement3>Value3</XMLelement3>
</Documents>
</DocumentElement>
But i want something like this
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<SomeGroupElement xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SomeGroupElement2 XMLElementA="ABCD" XMLElementB="123" XMLElementC="XYZ" XMLElementD="1">
<SomeGroupElement2 XMLElementZ="KLM">
<Grouping>
<XMLelement1>Value1</XMLelement1>
<XMLelement2>Value2</XMLelement2>
<XMLelement3>Value3</XMLelement3>
</Grouping>
</SomeGroupElement2>
</SomeGroupElement>
I have done some tests with XSLT and adding Elements on the fly ...and also by using the GetXML to get the string and manipulate it as a string by i feel there should be some better way.
P.S. XMLelement1,XMLelement2,XMLelement3 are fields of the DataTable/ along with their values.
P.S.2 I am pretty sure i am not using XML terminology correctly, sorry for that.