title: xpath to get position of childnode against the parent in XML
body: <p>I need to loop through all chilnodes in the parent node (callEvents) and save each time the position of the child node.(First call event, second call event...). I'm stack in how to get the position of each child node in the parent node java/xpath?</p>
  
  <p>say I have the following xml:</p>
  
  <pre><code>&lt;callEvents&gt;
            &lt;gprsCall&gt;...&lt;/gprsCall&gt;
            &lt;gprsCall&gt;...&lt;/gprsCall&gt;
            &lt;mobileOrigintaedCall&gt;...&lt;/mobileOrigintaedCall&gt;
            &lt;gprsCall&gt;...&lt;/gprsCall&gt;
            &lt;gprsCall&gt;...&lt;/gprsCall&gt;
  &lt;/callEvents&gt; 
  </code></pre>
  
  <p>So the code should return:</p>
  
  <ul>
  <li>My first gprsCall position = 1</li>
  <li>My second gprsCall position = 2</li>
  <li>My first mobileOriginatedCall position = 3</li>
  <li>My third gprsCall position = 4</li>
  <li>My fourth gprsCall position = 5</li>
  </ul>