Implement XML writer.