If the data is already in the XML format,
you should consider using a XSL Transfomrations to generate the output file. Simply store your output formatting logic in the stylesheet and apply transfomrations through the Java program.
IMO this will result in a very clean design since you are separating data from presentation logic. Directly generating HTML output may turnout to be clumsy and hard to maintain.
------------------
Ajith Kallambella M. Sun Certified Programmer for the Java�2 Platform.
IBM Certified Developer - XML and Related Technologies, V1.