Here you can find the source of getFirstChildByNodeName(Node parent, String nodeName)
public static Node getFirstChildByNodeName(Node parent, String nodeName)
//package com.java2s; //License from project: Open Source License import org.w3c.dom.Node; public class Main { public static Node getFirstChildByNodeName(Node parent, String nodeName) { for (Node n = parent.getFirstChild(); n != null; n = n.getNextSibling()) if (n.getNodeName().equals(nodeName)) return n; return null; }/*from w w w. j a v a 2 s . c om*/ }