Converted writing to XML