Here you can find the source of getChildNode(Node parentNode, String childElementName)
public static Node getChildNode(Node parentNode, String childElementName)
//package com.java2s; // Licensed to the Apache Software Foundation (ASF) under one import org.w3c.dom.Node; import org.w3c.dom.NodeList; public class Main { public static Node getChildNode(Node parentNode, String childElementName) { NodeList l = parentNode.getChildNodes(); for (int i = 0; i < l.getLength(); i++) { Node node = l.item(i); if (node.getNodeName().equals(childElementName)) return node; }//from ww w .java 2 s.co m return null; } }