Here you can find the source of getDirectChild(Node fNode, String localName, String namespace)
public static Node getDirectChild(Node fNode, String localName, String namespace)
//package com.java2s; /*//from ww w . j a v a2 s . c om This file is licensed under the terms of the Globus Toolkit Public License, found at http://www.globus.org/toolkit/download/license.html. */ import org.w3c.dom.Node; public class Main { public static Node getDirectChild(Node fNode, String localName, String namespace) { for (Node currentChild = fNode.getFirstChild(); currentChild != null; currentChild = currentChild .getNextSibling()) { // sometimes, namespace might be null somehow if ((namespace == null || namespace.equalsIgnoreCase(currentChild.getNamespaceURI())) && localName.equalsIgnoreCase(currentChild.getLocalName())) { return currentChild; } } return null; } }