try {
DocumentDocument doc = DocumentDocument.Factory.parse(getPackagePart().getInputStream());
ctDocument = doc.getDocument();
CTBody body = ctDocument.getBody();
initFootnotes();
// filling paragraph list
for (CTP p : body.getPArray()) {
paragraphs.add(new XWPFParagraph(p, this));
}
// Get any tables
for(CTTbl table : body.getTblArray()) {
tables.add(new XWPFTable(this, table));
}
// Sort out headers and footers
if (doc.getDocument().getBody().getSectPr() != null)