private void handleDocumentPart(PackagePart documentPart, StringBuilder sb)
            throws IOException, SAXException, TikaException {
        //load the numbering/list manager and styles from the main document part
        XWPFNumbering numbering = loadNumbering(documentPart);
        XWPFListManager xwpfListManager = new XWPFListManager(numbering);
        //TODO: XWPFStyles styles = loadStyles(documentPart);

        //headers
        try {
            PackageRelationshipCollection headersPRC =
                    documentPart.getRelationshipsByType(XWPFRelation.HEADER.getRelation());
            if (headersPRC != null) {
                for (int i = 0; i < headersPRC.size(); i++) {
                    PackagePart header = documentPart.getRelatedPart(headersPRC.getRelationship(i));
                    handlePart(header, xwpfListManager, sb);
                }
            }
        } catch (InvalidFormatException e) {
            LOG.warn("Invalid format", e);
        }

        //main document
        handlePart(documentPart, xwpfListManager, sb);

        //for now, just dump other components at end
        for (XWPFRelation rel : new XWPFRelation[]{XWPFRelation.FOOTNOTE, XWPFRelation.COMMENT,
                XWPFRelation.FOOTER, XWPFRelation.ENDNOTE}) {
            try {
                PackageRelationshipCollection prc =
                        documentPart.getRelationshipsByType(rel.getRelation());
                if (prc != null) {
                    for (int i = 0; i < prc.size(); i++) {
                        PackagePart packagePart =
                                documentPart.getRelatedPart(prc.getRelationship(i));
                        handlePart(packagePart, xwpfListManager, sb);
                    }
                }
            } catch (InvalidFormatException e) {
                LOG.warn("Invalid format", e);
            }
        }
    }
Experimental class that is based on POI's XSSFEventBasedExcelExtractor
tika-parsers/tika-parsers-standard/tika-parsers-standard-modules/tika-parser-microsoft-module/src/main/java/org/apache/tika/parser/microsoft/ooxml/xwpf/XWPFEventBasedWordExtractor.java