Inside the XML Serializer

The XML serializer is a powerful tool that can transform a fair number of .NET Framework classes into portable XML code. The key thing to note is that the serializer is a kind of compiler. It first imports type information from the class and then serializes it to the output stream. It also works the other way around. The serializer reads XML data and maps elements to the target class members.

Normally, serialization and deserialization are functions that each class implements in whatever way it determines is more convenient for its data. This is precisely what happens with run-time object serialization. XML serialization works differently, however. With the XML serializer, you have a compiler tool that takes information ...

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.