Java tutorial
//package com.java2s; import org.w3c.dom.Element; public class Main { public static String getTextNodeContent(Element e) { return e.getFirstChild() == null ? "" : e.getFirstChild().getNodeValue(); } }