Here you can find the source of readText(Node element)
public static String readText(Node element)
//package com.java2s; //License from project: Apache License import org.w3c.dom.Node; public class Main { public static String readText(Node element) { if (element == null) return ""; else/*from ww w . j a va 2s . co m*/ return element.getTextContent(); } }