The XML Serializer

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:

  1. The serializer generates an XSD schema for the target class that includes all the public properties and fields.

  2. 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 ...

Get Applied XML Programming for Microsoft® .NET now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.