Let\'s suppose I have this object:
[Serializable] public class MyClass { public int Age { get; set; } public int MyClassB { get; set; } } [Serializab
You can use XmlElementAttribute.IsNullable:
[Serializable] public class MyClass { [XmlElement(IsNullable = true)] public int? Age { get; set; } public int MyClassB { get; set; } }