Java tutorial
//package com.java2s; import org.w3c.dom.NodeList; public class Main { public static String getNodesText(NodeList nodes) { StringBuffer ret = new StringBuffer(); for (int i = 0, l = nodes.getLength(); i < l; i++) { ret.append(nodes.item(i).getTextContent()); } return ret.toString(); } }