XMLSerializer is introduced in .NET 1.0 and specially designed for working with ASMX services.
As per the design, it requires to serialize only public properties.
Also, XMLSerializer depends on the serialization assembly generated during run-time. XMLSerializer uses this runtime-generated assembly to serialize types. Doesn't use reflection. Hence, private variables are not serialized.