/*******************************************************************************
 * Copyright (c) 2004 Actuate Corporation.
 * 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:
 *  Actuate Corporation  - initial API and implementation
 *******************************************************************************/
package org.eclipse.birt.test.performance.reporting.xml;

import org.w3c.dom.Node;
import org.w3c.dom.NodeList;


public class XMLUtility
{
	public static Node findFirstChildByName( Node parent, String childName )
	{
		NodeList childs = parent.getChildNodes( );

		for ( int i = 0; i < childs.getLength( ); i++ )
		{
			Node child = childs.item( i );
			System.out.println( child.getNodeName( ) );
			System.out.println( child.getNodeValue( ) );

			if ( childName.equalsIgnoreCase( child.getNodeName( ) ) )
			{
				return child;
			}
		}
		return null;
	}
	
	
}
