fix serialization of null values in ToXml methods