Here you can find the source of getNodeValue(NodeList nodes)
public static String getNodeValue(NodeList nodes)
//package com.java2s; //License from project: Open Source License import org.w3c.dom.*; public class Main { public static String getNodeValue(NodeList nodes) { Node node = nodes.item(0); String value = null;//from w w w .j a v a2 s . c o m if (nodes.getLength() > 0) { NodeList children = node.getChildNodes(); int length = children.getLength(); if (length == 1) { Node textNode = children.item(0); value = textNode.getNodeValue(); } } return value; } }