Here you can find the source of getChildNode(Node n, String name)
public static Node getChildNode(Node n, String name)
//package com.java2s; //License from project: Open Source License import org.w3c.dom.Node; import org.w3c.dom.NodeList; public class Main { public static Node getChildNode(Node n, String name) { if (n == null) { throw new IllegalArgumentException("null node"); }/* w w w. j a v a2 s . co m*/ if (name == null) { throw new IllegalArgumentException("null name"); } NodeList l = n.getChildNodes(); for (int i = 0; i < l.getLength(); i++) { Node node = l.item(i); if (name.equals(node.getLocalName())) { return node; } } return null; } }