Here you can find the source of getTextContent(Node e)
public static String getTextContent(Node e)
//package com.java2s; /**/* w ww. j a v a2 s.c om*/ * This file belongs to the BPELUnit utility and Eclipse plugin set. See enclosed * license file for more information. */ import org.w3c.dom.Node; import org.w3c.dom.NodeList; public class Main { public static String getTextContent(Node e) { StringBuilder sb = new StringBuilder(); NodeList children = e.getChildNodes(); if (children != null) { for (int i = 0; i < children.getLength(); i++) { Node n = children.item(i); if (n.getNodeType() == Node.TEXT_NODE) { sb.append(n.getNodeValue()); } } } return sb.toString(); } }