I recommend XMLBeans (Apache library free for use:
http://xmlbeans.apache.org/). It doesn't exactly solve your problem, but can be used to create an XSD (an XML file that defines an XML structure) that closely ties in with your class. The more common use though, is to take an XSD, generate java bean classes out of it, and then to use those beans to automatically create XML files out loaded data.
Once the Bean classes have been generated from an XSD, generating an XML file from data is a trivial process... you just load the data into these generated been classes using the factory methods, then output the data using save() to an output stream.