public static String nodeValue(Node node){
  if (node == null)   return null;
  StringBuilder valueBuffer=new StringBuilder();
  do {
    if (node.getNodeType() == Node.CDATA_SECTION_NODE || node.getNodeType() == Node.TEXT_NODE || node.getNodeType() == Node.COMMENT_NODE) {
      valueBuffer.append(node.getNodeValue());
    }
  }
 while ((node=node.getNextSibling()) != null);
  return valueBuffer.toString();
}

public static String nodeValue ( Node node ) { if ( node == null ) return null ; StringBuilder valueBuffer = new StringBuilder ( ) ; do { if ( node . getNodeType ( ) == Node . CDATA_SECTION_NODE || node . getNodeType ( ) == Node . TEXT_NODE || node . getNodeType ( ) == Node . COMMENT_NODE ) { valueBuffer . append ( node . getNodeValue ( ) ) ; } } while ( ( node = node . getNextSibling ( ) ) != null ) ; return valueBuffer . toString ( ) ; }
return the text ( node value ) of the first node under this
