My XML is
<root>
<source>
<item>
<id>111</id>
<qty>2</qty>
</item>
<item>
<id>222</id>
<qty>1</qty>
</item>
<item>
<id>333</id>
<qty>4</qty>
</item>
</source>
<target>
<record>
<id>111</id>
<price>1000</price>
</record>
<record>
<id>333</id>
<price>500</price>
</record>
</target>
</root>
Now i need to match the id element of source/item and target/record if it matches i need to product the
source/item/qty * target/record/price
Once the product is done for all the matching case i should sum all product value and should get the result as
4000 i.e (sum(qty * price) of all matching elements.)
How to achieve this kindly help me on this , thanks in advance