optimizing XmlWriter