If a property is Integer or Float and has value = 0 or 0.0f then this property isn't write to XML.

Properties containing 0 (Integer) or 0.0f (Float) aren't write to XML, however 0 or 0.0f can be a meaningful value in several domains. I've changed the test from "if (val)" to "if (val != null)", this way this properties are correctly rendered in XML.