From the name you probably guessed that theXmlSerializer serializes data into XML. It gives you more control over the XML structure of the serialized data. Typical real-world examples for using this serializer would be to maintain compatibility with XML web services. It is also an easy medium to use when transmitting data using some type of message queuing (such as MSMQ or RabbitMQ).
The default behavior of XmlSerializer is to serialize public fields and properties. Using attributes from the System.Xml.Serialization namespace, you can control the structure of your XML.