- Read the documentation,
- You can use XmlDocument and use ValidationType.DTD in DTD processing with XmlReaderSettings to parse and validate XML document agains DTDs
- Look into simiar question here
- You can use NewtonSoft JSON serialization library to serialize objects into JSON format
- Additionally, you can use dynamically generated JSON,
class cXMLJsonNode : Dictionary<string,object>
{
}
to create custom built JSON object:
JsonConvert.SerializeObject(new cXMLJsonNode {
{ key1, value1 },
{ key2, value2 },
{ property1, new cXMLJsonNode {
{ key1, oldValue1 }
{ key2, oldValue1 }
},
{ property2, new cXMLJsonNode {
{ key1, newValue1 }
{ key2, new cXMLJsonNode {
{ key1, newValue1 }
{ key2, newValue2 }
}
},
})