XML Serialize boolean as 0 and 1
The XML Schema Part 2 specifies that an instance of a datatype that is defined as boolean can have the following legal literals {true, false, 1, 0}. The following XML, for example, when deserialized, sets the boolean property "Emulate" to true . <root> <emulate>1</emulate> </root> However, when I serialize the object back to the XML, I get true instead of the numerical value. My question is, is there a way that I can control the boolean representation in the XML? You can implement IXmlSerializable which will allow you to alter the serialized output of your class however you want. This will