private void closeStyleTags() throws SAXException {
        // Close any still open style tags
        if (curUnderlined) {
            handler.endElement(XHTML, "u", "u");
            curUnderlined = false;
        }
        if (curItalic) {
            handler.endElement(XHTML, "i", "i");
            curItalic = false;
        }
        if (curBold) {
            handler.endElement(XHTML, "b", "b");
            curBold = false;
        }
        currTextStyle = null;
        hasWrittenStartStyleTags = false;
    }
Check if a node is a text node
tika-parsers/tika-parsers-standard/tika-parsers-standard-modules/tika-parser-miscoffice-module/src/main/java/org/apache/tika/parser/odf/OpenDocumentBodyHandler.java