I need to serialize / deserialize a datetime into yyyyMMdd format for an XML file. Is there an attribute / workaround I can use for this?
XmlElementAttribute#DataType should provide what you need:
[XmlElement(DataType="date")] public DateTime Date1 {get;set;}
This will get Date1 property serialized to the proper xml date format.