title: Parse the nested tag element by method getElementsByTagName method
body: <pre><code>&lt;Order&gt;
  &lt;AmazonOrderID&gt;406-6143419-7223518&lt;/AmazonOrderID&gt;
  &lt;MerchantOrderID&gt;406-6143419-7223518&lt;/MerchantOrderID&gt;
  &lt;ShipmentID&gt;DDNSkvgJN&lt;/ShipmentID&gt;
  &lt;MarketplaceName&gt;Amazon.in&lt;/MarketplaceName&gt;
  &lt;Fulfillment&gt;
  &lt;MerchantFulfillmentID&gt;AFN&lt;/MerchantFulfillmentID&gt;
  &lt;PostedDate&gt;2017-07-22T08:31:18+00:00&lt;/PostedDate&gt;
  &lt;Item&gt;
  &lt;AmazonOrderItemCode&gt;31251963544243&lt;/AmazonOrderItemCode&gt;
  &lt;SKU&gt;DZ-HA0T-A5GQ&lt;/SKU&gt;
  &lt;Quantity&gt;1&lt;/Quantity&gt;
  &lt;ItemPrice&gt;
  &lt;Component&gt;
  &lt;Type&gt;Principal&lt;/Type&gt;
  &lt;Amount currency="INR"&gt;780.47&lt;/Amount&gt;
  &lt;/Component&gt;
  &lt;Component&gt;
  &lt;Type&gt;Shipping&lt;/Type&gt;
  &lt;Amount currency="INR"&gt;13.02&lt;/Amount&gt;
  &lt;/Component&gt;
  &lt;Component&gt;
  &lt;Type&gt;Tax&lt;/Type&gt;
  &lt;Amount currency="INR"&gt;174.78&lt;/Amount&gt;
  &lt;/Component&gt;
  &lt;/ItemPrice&gt;
  &lt;ItemFees&gt;
  &lt;Fee&gt;
  &lt;Type&gt;FBAPerUnitFulfillmentFee&lt;/Type&gt;
  &lt;Amount currency="INR"&gt;-10.00&lt;/Amount&gt;
  &lt;/Fee&gt;
  &lt;Fee&gt;
  &lt;Type&gt;FBAPerUnitFulfillmentFeeTax&lt;/Type&gt;
  &lt;Amount currency="INR"&gt;-1.80&lt;/Amount&gt;
  &lt;/Fee&gt;
  &lt;Fee&gt;
  &lt;Type&gt;FBAWeightBasedFee&lt;/Type&gt;
  &lt;Amount currency="INR"&gt;-43.00&lt;/Amount&gt;
  &lt;/Fee&gt;
  &lt;Fee&gt;
  &lt;Type&gt;FBAWeightBasedFeeTax&lt;/Type&gt;
  &lt;Amount currency="INR"&gt;-7.74&lt;/Amount&gt;
  &lt;/Fee&gt;
  &lt;Fee&gt;
  &lt;Type&gt;Commission&lt;/Type&gt;
  &lt;Amount currency="INR"&gt;-135.83&lt;/Amount&gt;
  &lt;/Fee&gt;
  &lt;Fee&gt;
  &lt;Type&gt;CommissionTax&lt;/Type&gt;
  &lt;Amount currency="INR"&gt;-24.45&lt;/Amount&gt;
  &lt;/Fee&gt;
  &lt;Fee&gt;
  &lt;Type&gt;FixedClosingFee&lt;/Type&gt;
  &lt;Amount currency="INR"&gt;-20.00&lt;/Amount&gt;
  &lt;/Fee&gt;
  &lt;Fee&gt;
  &lt;Type&gt;FixedClosingFeeTax&lt;/Type&gt;
  &lt;Amount currency="INR"&gt;-3.60&lt;/Amount&gt;
  &lt;/Fee&gt;
  &lt;/ItemFees&gt;
  &lt;Promotion&gt;
  &lt;MerchantPromotionID&gt;DCMS-3f4089f9-060b2c1e&lt;/MerchantPromotionID&gt;
  &lt;Type&gt;Principal&lt;/Type&gt;
  &lt;Amount currency="INR"&gt;-156.25&lt;/Amount&gt;
  &lt;/Promotion&gt;
  &lt;Promotion&gt;
  &lt;MerchantPromotionID&gt;IN Core Free Shipping 2015/04/08 23-48-5-108&lt;/MerchantPromotionID&gt;
  &lt;Type&gt;Shipping&lt;/Type&gt;
  &lt;Amount currency="INR"&gt;-13.02&lt;/Amount&gt;
  &lt;/Promotion&gt;
  &lt;/Item&gt;
  &lt;/Fulfillment&gt;
  &lt;/Order&gt;
  </code></pre>
  
  <p>I have the following xml structure which repeats n times. I want to extract all the amount corresponding to the types i.e Principal, Shipping(repeated pl look below), FixedClosingFee. I want to parse by nested getElementbyTagname for ex:- ItemPrice->Component->type and its corresponding Amount.  </p>