Here you can find the source of getChildTextNode(Element el)
public static Text getChildTextNode(Element el)
//package com.java2s; import org.w3c.dom.*; public class Main { /**/*from w ww .ja v a2s. c o m*/ * Gets the child text node containing character data * for the given DOM element. */ public static Text getChildTextNode(Element el) { if (el == null) return null; NodeList list = el.getChildNodes(); int size = list.getLength(); for (int i = 0; i < size; i++) { Node node = list.item(i); if (!(node instanceof Text)) continue; return (Text) node; } return null; } }