Well, if it works then it would seem to be enough
There are any number of ways to generate XML (DOM, XOM, JDOM, dom4j, XSLT, ...). The decision which one to use comes down to a variety of factors, including which one is already known or in use in the project, and maybe performance (if that proves to be a problem).
Does the current implementation meet your needs?