title: Get the value and index of array attribute of xmlns data using postgresql query
body: <pre><code>&lt;sample-test-data-history xmlns="dmotorworks.com/sample-test-data-history"&gt; &lt;payPaymentCode&gt; 
  &lt;V Idx="1"&gt;CASH&lt;/V&gt;
   &lt;/payPaymentCode&gt;
   &lt;StatusCode&gt;C98&lt;/StatusCode&gt; 
  &lt;Type&gt; 
  &lt;V Idx="1"&gt;Cat&lt;/V&gt; 
  &lt;V Idx="2"&gt;Mouse&lt;/V&gt; 
  &lt;V Idx="3"&gt;Tree&lt;/V&gt; 
  &lt;/Type&gt; 
  &lt;totMiscCost&gt; 
  &lt;V Idx="1"&gt;100.00&lt;/V&gt; 
  &lt;V Idx="2"&gt;150.00&lt;/V&gt; 
  &lt;V Idx="3"&gt;200.00&lt;/V&gt; 
  &lt;/totMiscCost&gt; 
  &lt;/sample-test-data-history&gt; 
  </code></pre>
  
  <p>From this xmlns i need to get the idx value of the array for which the text is "cat" and based on that Idx value I need to get totMiscCost from the next array attribute with the same Idx value</p>