Java tutorial
//package com.java2s; import org.w3c.dom.*; public class Main { public static String getNodeValue(Node node) { String ret = ""; if (node != null) { for (Node child = node.getFirstChild(); child != null; child = child.getNextSibling()) ret = (new StringBuilder(String.valueOf(ret))).append(child.getNodeValue()).toString(); } return ret; } }