I'm trying to create an XML document from a complex result set, i.e. a result set with multiple joins, so a competition has a bunch of questions, and a question has a bunch of answers.
So the document would end up looking something like:
<competitions>
<competition id="12">
<question id="3">
<answer id="34">
The answer
</answer>
<answer id="35">
The answer
</answer>
<answer id="36">
The answer
</answer>
</question>
...
A lot like the "for XML" command in SQL Server, but I can't use the database to do the processing, so it needs to be in Java. Can anyone point me in the right direction to any good resources or even open source libraries that do this / a similar thing so I can make it do what I want please? Thanks.