If I understand correctly, then not without the implementation of IXmlSerializable (which is not fun, not there). There are things like ShouldSerialize* / *Specified templates, but it still won't write anything for null (even if you return true).
source share