Last Updated: May 17, 2026
XML serialization is the process of turning a C# object into XML text and reading it back into an object. JSON has taken over most modern APIs, but XML is still everywhere: SOAP services, build files like .csproj, configuration formats like web.config, document-centric data exchange, and any system that wants schema validation through XSD. This lesson covers the two main APIs that ship with .NET, XmlSerializer for object mapping and the XmlReader/XmlWriter/XDocument family for direct XML manipulation, plus the trade-offs between them and the pitfalls that catch people when they pick the wrong tool.