Here you can find the source of hasTextContent(Node child)
public static boolean hasTextContent(Node child)
//package com.java2s; import org.w3c.dom.Node; public class Main { public static boolean hasTextContent(Node child) { return child.getNodeType() != Node.COMMENT_NODE && child.getNodeType() != Node.PROCESSING_INSTRUCTION_NODE; }/* w w w . ja va2s .c om*/ }