How to serialize object collection / dictionary into <key>value</key>

c1pr1an

New Member
We're looking for a way to serialize key/value pairs (preferably strongly typed, but possibly also sourced from a Dictionary) into the desired format below. Any ideas?\[code\]public List<Identifier> Identifiers = new List<Identifiers>();public class Identifier{ public string Name { get; set; } public string Description { get; set; }}\[/code\]OR\[code\]public Dictionary<string, string> Identifiers = new Dictionary<string,string>{ { "somename", "somedescription"}, { "anothername", "anotherdescription" }};\[/code\]Serialized into this:\[code\]<Identifiers> <somename>somedescription</somename> <anothername>anotherdescription</anothername></Identifiers>\[/code\]Happy to use XmlSerializer, DataContractSerializer, or any other solution really...
 
Back
Top