How do you mean?

.NET has very good built-in serialization to and from XML:
System.Xml.Serialization.XmlSerializer

If you want to write your own you can use reflection to enumerate and read fields from a class.