private static void createStructureTreeFromDocument(InputStream foInputStream,
Result result) throws Exception {
TransformerHandler tHandler = createTransformerHandler(result);
startStructureTreeSequence(tHandler);
StructureTreeEventHandler structureTreeEventHandler
= StructureTree2SAXEventAdapter.newInstance(tHandler);
FODocumentParser documentParser = createDocumentParser(structureTreeEventHandler);
FOUserAgent userAgent = createFOUserAgent(documentParser);
parseDocument(foInputStream, documentParser, userAgent);
endStructureTreeSequence(tHandler);