In my opinion, the most beneficial way (by far the most) is this: create some pure-data classes and make some data graph (does not have to be tree, can be a more general-structure graph) to express your data model and store/load it using Microsoft Data Contract.
This way is very non-intrusive and robust. You only add [
DataContract
] attributes to your types and [
DataMember
] to your members.
System.Runtime.Serialization.DataContractSerializer
does the trick. Don't forget to set up your unique company name space in
DataContract
— the auto-generated XML meta-data (and hence your data format) will be recognized as world-unique.
See
System.Runtime.Serialization.DataContractAttribute
,
System.Runtime.Serialization.DataMemberAttribute
and
System.Runtime.Serialization.DataContractSerializer
,
http://msdn.microsoft.com/en-us/library/system.runtime.serialization.datacontractserializer.aspx[
^]
—SA