int level ) throws XPathExpressionException
int level )
	private static void populateNodeList( NodeList nodeList, ATreeNode root,			int level ) throws XPathExpressionException	{		for ( int i = 0; i < nodeList.getLength( ); i++ )		{			boolean goToNextLevel = false;			String space = "";			for ( int t = 0; t < level; t++ )			{				space += "   ";			}			Node item = nodeList.item( i );			if ( item.getLocalName( ) != null )			{				ATreeNode node = new ATreeNode( );				if ( item.getLocalName( ).equals( "element" )						|| item.getLocalName( ).equals( "attribute" ) )				{					String name = "<NULL>";					//String type = "<NULL>";					if ( item.getAttributes( ).getNamedItem( "name" ) != null )					{						name = item.getAttributes( )								.getNamedItem( "name" )								.getNodeValue( );						//type = "name";					}					else					{						name = item.getAttributes( )								.getNamedItem( "ref" )								.getNodeValue( );						//type = "ref";					}					node.setParent( root );					node.setValue( name );					if ( item.getLocalName( ).equals( "element" ) )						node.setType( ATreeNode.ELEMENT_TYPE );					else						node.setType( ATreeNode.ATTRIBUTE_TYPE );					goToNextLevel = true;				}				if ( item.getChildNodes( ).getLength( ) != 0 )				{					populateNodeList( item.getChildNodes( ), goToNextLevel							? node : root, goToNextLevel ? level + 1 : level );				}			}		}	}