Java tutorial
//package com.java2s; import org.w3c.dom.Node; import org.w3c.dom.Text; public class Main { public static String getNodeText(Node node) { if (node != null) { Text bb = (Text) node.getChildNodes().item(0); return bb.getNodeValue(); } return ""; } }