private static boolean isWhitespaceNode(Node node){
  if (node.getNodeType() != Node.TEXT_NODE) {
    return false;
  }
  String value=node.getNodeValue();
  for (int i=0; i < value.length(); i++) {
    if (!Character.isWhitespace(value.charAt(i))) {
      return false;
    }
  }
  return true;
}

private static boolean isWhitespaceNode ( Node node ) { if ( node . getNodeType ( ) != Node . TEXT_NODE ) { return false ; } String value = node . getNodeValue ( ) ; for ( int i = 0 ; i < value . length ( ) ; i ++ ) { if ( ! Character . isWhitespace ( value . charAt ( i ) ) ) { return false ; } } return true ; }
checks if the node is a white space .
