XmlWriter: optimizing XmlWriter