XML serialization generally follows the same principles as the BinaryFormatter and SoapFormatter classes that you’ve already seen. But XML serialization has some important advantages:
The “different class versions” problem does not apply to XML deserialization; the deserialization process simply assigns existing data to matching properties of the class that you want to deserialize.
XML code is easy to read and can be imported and processed by many different programs.
Nevertheless, you must make certain compromises when creating classes for XML serialization:
Like other classes with which you want to use .NET serialization, they must be marked with the Serializable attribute.
The class you want to serialize in XML format must have ...