finished optimization of XmlWriter