Here you can find the source of getBeanElement(Node elem, String nodeName)
private static Node getBeanElement(Node elem, String nodeName)
//package com.java2s; /******************************************************************************* * Copyright (c) 2006, 2009 Spring IDE Developers * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors:// w ww . j a v a 2s. c om * Spring IDE Developers - initial API and implementation *******************************************************************************/ import org.w3c.dom.Node; public class Main { private static Node getBeanElement(Node elem, String nodeName) { if (!nodeName.equals(elem.getLocalName()) && !elem.getOwnerDocument().equals(elem.getParentNode())) { return getBeanElement(elem.getParentNode(), nodeName); } else { return elem; } } }