org.docx4j.wml.Document docxDoc = (org.docx4j.wml.Document) docxMdp.getJaxbElement();
return docxDoc.getBody();
}
public static WordprocessingMLPackage clone(WordprocessingMLPackage docxTemplate) throws MergeException {
FlatOpcXmlCreator foxc = new FlatOpcXmlCreator(docxTemplate);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
try {
foxc.marshal(baos);
ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
FlatOpcXmlImporter foxi = new FlatOpcXmlImporter(bais);
docxTemplate = (WordprocessingMLPackage) foxi.get();
} catch (Docx4JException e) {
throw new MergeException("unable to defensive copy (problem exporting)", e);