//Iterate over all intermediate files
AreaTreeParser parser = new AreaTreeParser();
ContentHandler handler = parser.getContentHandler(treeModel, ua);
DelegatingContentHandler proxy = new DelegatingContentHandler() {
public void endDocument() throws SAXException {
super.endDocument();
//Signal the end of the processing.
//The renderer can finalize the target document.
treeModel.endDocument();
}
};
proxy.setDelegateContentHandler(handler);
Transformer transformer = tfactory.newTransformer();
transformer.transform(new DOMSource(areaTreeXML), new SAXResult(proxy));
return (Document)result.getNode();