Here you can find the source of getText(Element config)
public static String getText(Element config)
//package com.java2s; //License from project: Open Source License import org.w3c.dom.Element; import org.w3c.dom.NodeList; import org.w3c.dom.Text; public class Main { /**// ww w . j a v a 2 s. c o m * returns the first text child within the node. */ public static String getText(Element config) { if (config == null) { throw new IllegalArgumentException("config cannot be null"); } NodeList children = config.getChildNodes(); for (int i = 0; i < children.getLength(); i++) { if (children.item(i) instanceof Text) { return children.item(i).getNodeValue(); } } // nothing found, return null return null; } }