Serializing classes in C#. nested XML
- by Jebli
Hi All,
I have to generate XML in the below format
<objects>
<items>
<item ="delete">
<searchfields>
<searchfield name="itemname" value="itemValue" />
</searchfields>
</item>
</items>
</objects>
So I have generated the CS file using xsd.exe by converting the above XML to XSD.
xsd.exe -c -l:c# -n:XmlSerializationDeleteObject DeleteObject.xsd
The CS file that is generated contains 4 classes.
My question is i have to build the XML in the above mentioned format using the class that is generated. I am able to serialize the class files one by one which retirns one tag at a time, but i am unable to build it in the way that i mentioned above.
Please help
Regardas,
jebli