Possible Duplicate:
Easy way to convert a Dictionary<string, string> to xml and visa versa
I have sample class:
public class SampleClass
{
public Dictionary<string, List<string>> SampleProperties {get;set;}
}
I want serialize this class to xml.
How I can do this?
I want output xml similar to this example:
<DataItem>
<key>
<value></value>
<value></value>
<value></value>
</key>
</DataItem>
Regards
You can use Linq to Xml to create required xml from your SampleClass object:
Output:
De-serializing from xml: