WordprocessingMLPackage wordMLPackage = WordprocessingMLPackage.createPackage();
wordMLPackage.getMainDocumentPart().setJaxbElement(
(Document)XmlUtils.unmarshalString(table1XML));
FOSettings foSettings = Docx4J.createFOSettings();
foSettings.setWmlPackage(wordMLPackage);
OutputStream os = null;
if (save) {
os = new FileOutputStream(new File(System.getProperty("user.dir") + "/OUT_testTblIndentOnCentredTable.pdf"));
wordMLPackage.save(new File(System.getProperty("user.dir") + "/OUT_testTblIndentOnCentredTable.docx"));
} else {
// want the fo document as the result.
foSettings.setApacheFopMime(FOSettings.INTERNAL_FO_MIME);
// exporter writes to an OutputStream.
os = new ByteArrayOutputStream();
}