This free open source taglib provides well documented JSP actions that
serialize DOM trees and produce XML constructs: elements, start/end
tags, character data, CDATA sections, comments and processing
instructions. It comes with a code builder that takes a sample
XML document and generates a JSP page that outputs the sample XML
content. You may edit the generated JSP in order to make it more
general so that it can output XML documents that are similar to the
given XML sample.