writing xml doc, part way through