Implement xmlwriter