I have this XML:
<?xml version="1.0" encoding="UTF-8"?>
<Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<MessageType>OrderReport</MessageType>
<Message>
<MessageID>1</MessageID>
<OrderReport>
<OrderID>058-4466335-2285957</OrderID>
<SessionID>102-1725329-2267355</SessionID>
<OrderDate>2004-08-30T08:04:50-07:00</OrderDate>
<OrderPostedDate>2004-08-30T08:04:55-07:00</OrderPostedDate>
<BillingData>
<BuyerEmailAddress>lynkendrick@yahoo.com</BuyerEmailAddress>
<BuyerName>Lyn Kendrick</BuyerName>
<BuyerPhoneNumber>505-988-7113</BuyerPhoneNumber>
</BillingData>
<FulfillmentData>
<FulfillmentMethod>Ship</FulfillmentMethod>
<FulfillmentServiceLevel>Standard</FulfillmentServiceLevel>
<Address>
<Name>Zachary Kendrick</Name>
<AddressFieldOne>3682 W. Atwater</AddressFieldOne>
<City>Fresno</City>
<StateOrRegion>CA</StateOrRegion>
<PostalCode>93711</PostalCode>
<CountryCode>US</CountryCode>
<PhoneNumber>559-432-6371</PhoneNumber>
</Address>
</FulfillmentData>
<Item>
<OrderItemCode>54569883065558</OrderItemCode>
<SKU>11320221A</SKU>
<Title>Prince Triple Threat Scream OS Grip Size: 1/8 Tennis Racquet</Title>
<Quantity>1</Quantity>
<ProductTaxCode>A_GEN_NOTAX</ProductTaxCode>
<ItemPrice>
<Component>
<Type>Principal</Type>
<Amount currency="USD">89.95</Amount>
</Component>
<Component>
<Type>Shipping</Type>
<Amount currency="USD">1.74</Amount>
</Component>
<Component>
<Type>Tax</Type>
<Amount currency="USD">0.00</Amount>
</Component>
<Component>
<Type>ShippingTax</Type>
<Amount currency="USD">0.00</Amount>
</Component>
<Component>
<Type>GiftWrap</Type>
<Amount currency="USD">0.00</Amount>
</Component>
<Component>
<Type>GiftWrapTax</Type>
<Amount currency="USD">0.00</Amount>
</Component>
</ItemPrice>
<ItemFees>
<Fee>
<Type>Commission</Type>
<Amount currency="USD">-13.49</Amount>
</Fee>
</ItemFees>
<Promotion>
<PromotionClaimCode>_SITE_WIDE_</PromotionClaimCode>
<MerchantPromotionID>AugFreeShipping</MerchantPromotionID>
<Component>
<Type>Shipping</Type>
<Amount currency="USD">-1.74</Amount>
</Component>
</Promotion>
<GiftMessageText>Zac, Hope this racquet fits! Enjoy! Much love, Lyn & Curt</GiftMessageText>
</Item>
<Item>
<OrderItemCode>18815179612750</OrderItemCode>
<SKU>4132015</SKU>
<Title>Prince Force Backpack Tennis Bag - 6P904-010</Title>
<Quantity>1</Quantity>
<ProductTaxCode>A_GEN_NOTAX</ProductTaxCode>
<ItemPrice>
<Component>
<Type>Principal</Type>
<Amount currency="USD">19.95</Amount>
</Component>
<Component>
<Type>Shipping</Type>
<Amount currency="USD">1.74</Amount>
</Component>
<Component>
<Type>Tax</Type>
<Amount currency="USD">0.00</Amount>
</Component>
<Component>
<Type>ShippingTax</Type>
<Amount currency="USD">0.00</Amount>
</Component>
</ItemPrice>
<ItemFees>
<Fee>
<Type>Commission</Type>
<Amount currency="USD">-2.99</Amount>
</Fee>
</ItemFees>
<Promotion>
<PromotionClaimCode>_SITE_WIDE_</PromotionClaimCode>
<MerchantPromotionID>AugFreeShipping</MerchantPromotionID>
<Component>
<Type>Shipping</Type>
<Amount currency="USD">-1.74</Amount>
</Component>
</Promotion>
</Item>
<Item>
<OrderItemCode>53858858575846</OrderItemCode>
<SKU>5134003</SKU>
<Title>Penn Pro Regular Duty Can Tennis Ball</Title>
<Quantity>2</Quantity>
<ProductTaxCode>A_GEN_NOTAX</ProductTaxCode>
<ItemPrice>
<Component>
<Type>Principal</Type>
<Amount currency="USD">5.00</Amount>
</Component>
<Component>
<Type>Shipping</Type>
<Amount currency="USD">3.47</Amount>
</Component>
<Component>
<Type>Tax</Type>
<Amount currency="USD">0.00</Amount>
</Component>
<Component>
<Type>ShippingTax</Type>
<Amount currency="USD">0.00</Amount>
</Component>
</ItemPrice>
<ItemFees>
<Fee>
<Type>Commission</Type>
<Amount currency="USD">-0.76</Amount>
</Fee>
</ItemFees>
<Promotion>
<PromotionClaimCode>_SITE_WIDE_</PromotionClaimCode>
<MerchantPromotionID>AugFreeShipping</MerchantPromotionID>
<Component>
<Type>Shipping</Type>
<Amount currency="USD">-3.47</Amount>
</Component>
</Promotion>
</Item>
</OrderReport>
</Message>
<Message>
<MessageID>2</MessageID>
<OrderReport>
<OrderID>058-7463504-7400320</OrderID>
<SessionID>102-8259823-6018539</SessionID>
<OrderDate>2004-08-30T08:04:31-07:00</OrderDate>
<OrderPostedDate>2004-08-30T08:04:36-07:00</OrderPostedDate>
<BillingData>
<BuyerEmailAddress>freakfunky@aol.com</BuyerEmailAddress>
<BuyerName>Bill Coate</BuyerName>
<BuyerPhoneNumber>212.965.1870</BuyerPhoneNumber>
</BillingData>
<FulfillmentData>
<FulfillmentMethod>Ship</FulfillmentMethod>
<FulfillmentServiceLevel>Standard</FulfillmentServiceLevel>
<Address>
<Name>Bill Coate</Name>
<AddressFieldOne>10 West St. # 24-D</AddressFieldOne>
<City>New York</City>
<StateOrRegion>NY</StateOrRegion>
<PostalCode>10004</PostalCode>
<CountryCode>US</CountryCode>
<PhoneNumber>212.965.1870</PhoneNumber>
</Address>
</FulfillmentData>
<Item>
<OrderItemCode>32316429306518</OrderItemCode>
<SKU>11510075B</SKU>
<Title>Wilson nCode nSixOne Tour 90 Tennis Racquet - T7561P Grip Size: 4 1/4</Title>
<Quantity>1</Quantity>
<ProductTaxCode>A_GEN_NOTAX</ProductTaxCode>
<ItemPrice>
<Component>
<Type>Principal</Type>
<Amount currency="USD">179.95</Amount>
</Component>
<Component>
<Type>Shipping</Type>
<Amount currency="USD">6.95</Amount>
</Component>
<Component>
<Type>Tax</Type>
<Amount currency="USD">0.00</Amount>
</Component>
<Component>
<Type>ShippingTax</Type>
<Amount currency="USD">0.00</Amount>
</Component>
</ItemPrice>
<ItemFees>
<Fee>
<Type>Commission</Type>
<Amount currency="USD">-26.99</Amount>
</Fee>
</ItemFees>
<Promotion>
<PromotionClaimCode>_SITE_WIDE_</PromotionClaimCode>
<MerchantPromotionID>AugFreeShipping</MerchantPromotionID>
<Component>
<Type>Shipping</Type>
<Amount currency="USD">-6.95</Amount>
</Component>
</Promotion>
</Item>
</OrderReport>
</Message>
</Envelope>
I want to add the Shipping Totals for each of the different orders (Message) into one total that I store in the Orders Table of my DB. I guess I need to use recursion, but nothing I have read on this is making any sense to me. It also does not help that they are using a <Component> tag then a <Type> to identify what each pricing item is. How do I return just the Shipping value, then add them up for a grand total?
(Better formated example available on request)