Implement XML output via DOM parser.