Hey everyone!

i'm using hibernate in my project to retrive and insert data to database. Now I want to export the retrived data to a xml file? I searched google, but I didint find anything.

Are there any apis that write/validate a sql query to an xml file?
I think that using a fileoutputstream or filewriter to make a xml file isnt the best way or am I wrong?