Suppose we have a class which can be serialized/deserialized by XmlSerializer. It would be like so:
[XmlRoot(\"ObjectSummary\")]
public class Summary
{
The way I do it - which is suboptimal but have not found a better way - is to define two properties:
[XmlRoot("ObjectSummary")]
public class Summary
{
public string Name {get;set;}
[XmlIgnore]
public bool IsValid {get;set;}
[XmlElement("IsValid")]
public string IsValidXml {get{ ...};set{...};}
}
Replace ... with the simple code to read and write the IsValid value to Y and N and read from it.