static org.w3c.dom.Document getAreaTreeViaFOP(WordprocessingMLPackage hfPkg, boolean useXSLT) throws Docx4JException, ParserConfigurationException, SAXException, IOException {
// Currently FOP dependent! But an Antenna House version ought to be feasible.
FOSettings foSettings = Docx4J.createFOSettings();
foSettings.setWmlPackage(hfPkg);
foSettings.setApacheFopMime(MimeConstants.MIME_FOP_AREA_TREE);
foSettings.setLayoutMasterSetCalculationInProgress(true); // avoid recursion
// foSettings.getFeatures().add(ConversionFeatures.PP_PDF_APACHEFOP_DISABLE_PAGEBREAK_LIST_ITEM); // in 3.0.1, this is off by default
if (log.isDebugEnabled()) {
foSettings.setFoDumpFile(new java.io.File(System.getProperty("user.dir") + "/hf.fo"));
}
ByteArrayOutputStream os = new ByteArrayOutputStream();
if (useXSLT) {