I have two xml documents:
xml1.xml
<root>
<standardCosts period="May-15" siteNumber="002">
<wheyCreamStandardCost>2.655</wheyCreamStandardCost>
</standardCosts>
<standardCosts period="May-15" siteNumber="999">
<wheyCreamStandardCost>1.35</wheyCreamStandardCost>
</standardCosts>
</root>
xml2.doc
<root>
<standardCosts period="May-15" siteNumber="002">
<wheyCreamStandardCost>3.00</wheyCreamStandardCost>
</standardCosts>
<standardCosts period="May-15" siteNumber="051">
<wheyCreamStandardCost>2.655</wheyCreamStandardCost>
</standardCosts>
</root>
I would like to merge xml2.doc onto xml1.doc, using the tag attributes period / siteNumber as keys, to produce the following xml
<root>
<standardCosts period="May-15" siteNumber="002">
<wheyCreamStandardCost>3.00</wheyCreamStandardCost>
</standardCosts>
<standardCosts period="May-15" siteNumber="999">
<wheyCreamStandardCost>1.35</wheyCreamStandardCost>
</standardCosts>
<standardCosts period="May-15" siteNumber="051">
<wheyCreamStandardCost>2.655</wheyCreamStandardCost>
</standardCosts>
</root>
I'm unsure how to proceed. Any ideas?