How can I get the position of an element that has a descendant 'y' with value 'z' ?

Subject: How can I get the position of an element that has a descendant 'y' with value 'z' ?
From: "mohamed" <mohamed@xxxxxxxxx>
Date: Thu, 3 Feb 2000 17:05:46 -0500
Hi

How can I get the position of an element that has a descendant 'y' with value 'z' ?

<?xml version="1.0"?>
<elementList>
    <element>
        <x>
            <y>a</y>
        </x>
    </element>
    <element>
        <x>
            <y>z</y>
        </x>
    </element>
</elementList>
 
I would want to get the position of the element that has a descendant 'y' whose value is 'z' and put it in a variable, in the above example the value of the variable should be 2.
 
thank you
 
               
Current Thread