Hi
I have the following xml to be transformed. But I don't how to get the primary driver tag value in the transformed xml. Primary driver should be based on the driver nodes position. Can somebody help me?
<drivers>
<driver>
<first_name>Doug</first_name>
<last_name>Harry</last_name>
<vehicles>
<vehicle>
<vin>4T1BB46K08</vin>
<year>2008</year>
</vehicle>
</vehicles>
<records/>
</driver>
<driver>
<first_name>Sherry</first_name>
<last_name>Bloom</last_name>
<vehicles>
<vehicle>
<vin>5TDZA23C06</vin>
<year>2006</year>
</vehicle>
</vehicles>
<records/>
</driver>
</drivers>
Result should be
<Vehicles>
<vehicle>
<vin>4T1BB46K08</vin>
<year>2008</year>
<primarydriver>1</primarydriver>
</vehicle>
<vehicle>
<vin>5TDZA23C06</vin>
<year>2006</year>
<primarydriver>2</primarydriver>
</vehicle>
</Vehicles>