write xml to file