Here you can find the source of getNodeValue(Node node)
public static String getNodeValue(Node node)
//package com.java2s; import org.w3c.dom.Node; public class Main { public static String getNodeValue(Node node) { String value = null;/*from w ww .j a va 2 s . c om*/ if (node != null) { value = node.getNodeValue(); if (value == null) { value = node.getTextContent(); } } return value; } }