Here you can find the source of getChild(Element element, String name)
public static Element getChild(Element element, String name)
//package com.java2s; //License from project: Open Source License import org.w3c.dom.Element; import org.w3c.dom.Node; public class Main { public static Element getChild(Element element, String name) { String safeName = name.replaceAll("\\$", "::"); for (int i = 0; i < element.getChildNodes().getLength(); i++) { Node node = element.getChildNodes().item(i); if (node instanceof Element) { Element el = (Element) node; if (el.getNodeName().equals(safeName)) return el; }/* w w w . ja v a 2s.c om*/ } return null; } }