java can do this job.
you create a DOMTree, serialize it and write the file to harddisk.
the source can be databse,textfile or something else.
the tutorial from IBM is very good, i`ve used the tutorial manipulating datas with xslt, i think, and the book Java & XML from Bret Mclaughlin.
bernd