I have a few objects in my class
List<string> a
List<string> b
Dictionary<string,string> c
I want a resulting XML document that contains the data contained in these three object so that it would look like:
<myobject>
<as>
<a value="xxxxx" />
<a value="xxxxx" />
<a value="xxxxx" />
</as>
<bs>
<b value="xxxxx" />
<b value="xxxxx" />
<b value="xxxxx" />
</bs>
<cs>
<c key="x" value="xxxxx" />
<c key="x" value="xxxxx" />
<c key="x" value="xxxxx" />
</cs>
</myobject>
What is the most appropriate technique to use here? Should I just iterate through each object or is there an easier way to do this? Tere are a few XML writers in .Net and I'm unsure which to use. Is XML serialization the better way to go?
XmlSerializerwon't know how to serializeDictionary<string, string>without implementingIXmlSerializableor something like that.