I want the unique list of elements from XML document. If the occurrence of element is more than 1, i want to have the last occurrence in my output:
Please refer the below XML for getting unique list:
<Organization>
<Fund>
<id>001</id>
<name>ABC Ltd</name>
</Fund>
<Fund>
<id>002</id>
<name>DEF Limited</name>
</Fund>
<Fund>
<id>001</id>
<name>ABC Ltd.</name>
</Fund>
<Fund>
<id>002</id>
<name>DEF Corporation</name>
</Fund>
<Fund>
<id>003</id>
<name>XYZ LLC.</name>
</Fund>
</Organization>
The transform should output the below result:
<Organization>
<Fund>
<id>001</id>
<name>ABC Ltd.</name>
</Fund>
<Fund>
<id>002</id>
<name>DEF Corporation</name>
</Fund>
<Fund>
<id>003</id>
<name>XYZ LLC.</name>
</Fund>
</Organization>
*Please note the change in name tag of Fund with id 001 and 002.
Need the sample code in XSLT1. Thanks in advance.