Here you can find the source of isText(Node node)
private static boolean isText(Node node)
//package com.java2s; //License from project: Apache License import org.w3c.dom.*; public class Main { private static boolean isText(Node node) { int ntype = node.getNodeType(); return ntype == Node.TEXT_NODE || ntype == Node.CDATA_SECTION_NODE; }//from ww w. j a v a2 s .c o m }