private static String getTextContent(final Node node) {
        switch (node.getNodeType()) {
            case Node.ELEMENT_NODE:
            case Node.ATTRIBUTE_NODE:
            case Node.ENTITY_NODE:
            case Node.ENTITY_REFERENCE_NODE:
            case Node.DOCUMENT_FRAGMENT_NODE:
                return mergeTextContent(node.getChildNodes());
            case Node.TEXT_NODE:
            case Node.CDATA_SECTION_NODE:
            case Node.COMMENT_NODE:
            case Node.PROCESSING_INSTRUCTION_NODE:
                return node.getNodeValue();
            case Node.DOCUMENT_NODE:
            case Node.DOCUMENT_TYPE_NODE:
            case Node.NOTATION_NODE:
            default:
                return null;
        }
    }
private static String getTextContent ( final Node node ) { switch ( node . getNodeType ( ) ) { case Node . ELEMENT_NODE : case Node . ATTRIBUTE_NODE : case Node . ENTITY_NODE : case Node . ENTITY_REFERENCE_NODE : case Node . DOCUMENT_FRAGMENT_NODE : return mergeTextContent ( node . getChildNodes ( ) ) ; case Node . TEXT_NODE : case Node . CDATA_SECTION_NODE : case Node . COMMENT_NODE : case Node . PROCESSING_INSTRUCTION_NODE : return node . getNodeValue ( ) ; case Node . DOCUMENT_NODE : case Node . DOCUMENT_TYPE_NODE : case Node . NOTATION_NODE : default : return null ; } }
================================================================================================