Thanks for the quick response. I tried both the answers. It is not working as I expected. Please find the below Input and the expected Output. Thanks in Advance
Input:
<Billing>
<billSummary>
<billTo>
<accountNumber>130212192</accountNumber>
<MSISDN>1234567890</MSISDN>
</billTo>
<tax>
<amount>100.12</amount>
<description>TAXES</description>
</tax>
<charge>
<typeCode>ONE_TIME</typeCode>
<amount>100.12</amount>
<description>ONE_TIME_CHARGE</description>
</charge>
<charge>
<typeCode>ACCESS</typeCode>
<amount>100.12</amount>
<description>ACCESS_CHARGE</description>
</charge>
<tax>
<amount>100.12</amount>
<description>TAXES</description>
</tax>
<charge>
<typeCode>FEATURE</typeCode>
<amount>100.12</amount>
<description>FEATURE_CHARGE</description>
</charge>
<deduction>
<amount>100.12</amount>
<description>ADJUSTMENTS</description>
</deduction>
<charge>
<typeCode>AIRTIME</typeCode>
<amount>100.12</amount>
<description>AIRTIME_CHARGE</description>
</charge>
<charge>
<typeCode>LONG_DISTANCE</typeCode>
<amount>100.12</amount>
<description>LONG_DISTANCE_CHARGE</description>
</charge>
<charge>
<typeCode>ROAMING</typeCode>
<amount>100.12</amount>
<description>ROAMING_CHARGE</description>
</charge>
<deduction>
<amount>100.12</amount>
<description>ADJUSTMENTS</description>
</deduction>
</billSummary>
<billSummary>
<billTo>
<accountNumber>130212192</accountNumber>
<MSISDN>1234567890</MSISDN>
</billTo>
<tax>
<amount>100.12</amount>
<description>TAXES</description>
</tax>
<charge>
<typeCode>ONE_TIME</typeCode>
<amount>100.12</amount>
<description>ONE_TIME_CHARGE</description>
</charge>
<charge>
<typeCode>ACCESS</typeCode>
<amount>100.12</amount>
<description>ACCESS_CHARGE</description>
</charge>
<tax>
<amount>100.12</amount>
<description>TAXES</description>
</tax>
<charge>
<typeCode>FEATURE</typeCode>
<amount>100.12</amount>
<description>FEATURE_CHARGE</description>
</charge>
<deduction>
<amount>100.12</amount>
<description>ADJUSTMENTS</description>
</deduction>
<charge>
<typeCode>AIRTIME</typeCode>
<amount>100.12</amount>
<description>AIRTIME_CHARGE</description>
</charge>
<charge>
<typeCode>LONG_DISTANCE</typeCode>
<amount>100.12</amount>
<description>LONG_DISTANCE_CHARGE</description>
</charge>
<charge>
<typeCode>ROAMING</typeCode>
<amount>100.12</amount>
<description>ROAMING_CHARGE</description>
</charge>
<deduction>
<amount>100.12</amount>
<description>ADJUSTMENTS</description>
</deduction>
</billSummary>
</Billing>
Expected Output:
<Billing>
<billSummary>
<billTo>
<accountNumber>130212192</accountNumber>
<MSISDN>1234567890</MSISDN>
</billTo>
<tax>
<amount>100.12</amount>
<description>TAXES</description>
</tax>
<charge>
<typeCode>ONE_TIME</typeCode>
<amount>100.12</amount>
<description>ONE_TIME_CHARGE</description>
</charge>
<charge>
<typeCode>ACCESS</typeCode>
<amount>100.12</amount>
<description>ACCESS_CHARGE</description>
</charge>
<tax>
<amount>100.12</amount>
<description>TAXES</description>
</tax>
<charge>
<typeCode>FEATURE</typeCode>
<amount>100.12</amount>
<description>FEATURE_CHARGE</description>
</charge>
<deduction>
<amount>100.12</amount>
<description>ADJUSTMENTS</description>
</deduction>
<charge>
<typeCode>AIRTIME</typeCode>
<amount>100.12</amount>
<description>AIRTIME_CHARGE</description>
</charge>
<charge>
<typeCode>LONG_DISTANCE</typeCode>
<amount>100.12</amount>
<description>LONG_DISTANCE_CHARGE</description>
</charge>
<charge>
<typeCode>ROAMING</typeCode>
<amount>100.12</amount>
<description>ROAMING_CHARGE</description>
</charge>
<deduction>
<amount>100.12</amount>
<description>ADJUSTMENTS</description>
</deduction>
</billSummary>
<billSummary>
<billTo>
<accountNumber>130212192</accountNumber>
<MSISDN>1234567890</MSISDN>
</billTo>
<tax>
<amount>100.12</amount>
<description>TAXES</description>
</tax>
<charge>
<typeCode>ONE_TIME</typeCode>
<amount>100.12</amount>
<description>ONE_TIME_CHARGE</description>
</charge>
<charge>
<typeCode>ACCESS</typeCode>
<amount>100.12</amount>
<description>ACCESS_CHARGE</description>
</charge>
<tax>
<amount>100.12</amount>
<description>TAXES</description>
</tax>
<charge>
<typeCode>FEATURE</typeCode>
<amount>100.12</amount>
<description>FEATURE_CHARGE</description>
</charge>
<deduction>
<amount>100.12</amount>
<description>ADJUSTMENTS</description>
</deduction>
<charge>
<typeCode>AIRTIME</typeCode>
<amount>100.12</amount>
<description>AIRTIME_CHARGE</description>
</charge>
<charge>
<typeCode>LONG_DISTANCE</typeCode>
<amount>100.12</amount>
<description>LONG_DISTANCE_CHARGE</description>
</charge>
<charge>
<typeCode>ROAMING</typeCode>
<amount>100.12</amount>
<description>ROAMING_CHARGE</description>
</charge>
<deduction>
<amount>100.12</amount>
<description>ADJUSTMENTS</description>
</deduction>
</billSummary>
</Billing>
How about this: