The central element in the XML serialization architecture is the XmlSerializer class, which belongs to the System.Xml.Serialization namespace. The XML serialization process is articulated in the following steps:
The serializer generates an XSD schema for the target class that includes all the public properties and fields.
Using this XSD schema, the serializer generates a C# source file with a made-to-measure reader and writer class. The source file is compiled into a temporary assembly.
The Serialize and Deserialize methods are simply higher level interfaces for those writer and reader classes. This list does not cover all the features of XML serialization, but it certainly focuses on the key aspects. Let’s look more closely ...