Sometimes I want to emulate stored data of my classes without setting up a round trip to the database. For example, let\'s say I have the following classes:
Just mark up what you want to serialize with [XmlElement(name)] (or XmlAttribute, XmlRoot, etc) and then use the XmlSerializer. If you need really custom formating, implement IXmlSerializable.