I have the following XML file "C:/Data.xml".

If the attributes on Dimension, Metirc, Data date Matches then Add the amount values and remove the duplicate DS node.

I looked some examples on hashtable/hashmapping but I could not find that meets my creiteria. I appriciate any direction or suggestions on this.

<ED LG="US">
<DS name="1" source="A" freq="Day">
<Dimension name="code" value="3">
<Metric ref_name="A1-ACT">
<Data date="2011-03-04T00:00:00" amount="30" />
</Metric>
</Dimension>
</DS>



<DS name="1" source="A" freq="Day">
<Dimension name="code" value="3">
<Metric name="A1-ACT">
<Data date="2011-03-04T00:00:00" amount="40" />
</Metric>
</Dimension>
</DS>

<DS name="1" source="A" freq="Day">
<Dimension name="code" value="3">
<Metric name="A1-ACT">
<Data date="2011-03-05T00:00:00" amount="20" />
</Metric>
</Dimension>
</DS>

</ED>

Expected Result:

<ED LG="US">
<DS name="1" source="A" freq="Day">
<Dimension name="code" value="3">
<Metric ref_name="A1-ACT">
<Data date="2011-03-04T00:00:00" amount="70" />
</Metric>
</Dimension>
</DS>

<DS name="1" source="A" freq="Day">
<Dimension name="code" value="3">
<Metric name="A1-ACT">
<Data date="2011-03-05T00:00:00" amount="20" />
</Metric>
</Dimension>
</DS>

</ED>

thanks