I have an XML file
<products>
<product number="241">
<investment number="29">
<rateLevel number="2">
<ticker>ttt</ticker>
<Cusip>1234</Cusip>
<secId>ffff</secId>
<investmentName>google</investmentName>
<marketingStatusCode/>
<marketingStatusReason/>
<tiers>
<tier>R6</tier>
</tiers>
</rateLevel>
</investment>
</product>
<product number="241">
<investment number="28">
<rateLevel number="3">
<ticker>bbb</ticker>
<Cusip>233</Cusip>
<secId>tiee</secId>
<investmentName>apple</investmentName>
<marketingStatusCode/>
<marketingStatusReason/>
<tiers>
<tier>R2</tier>
</tiers>
</rateLevel>
</investment>
</product>
<product number="200">
<investment number="8214">
<rateLevel number="20">
<ticker>yyyy</ticker>
<Cusip>5655</Cusip>
<secId>ghos</secId>
<investmentName>microsof</investmentName>
<marketingStatusCode/>
<marketingStatusReason/>
<tiers>
<tier>Signature</tier>
</tiers>
</rateLevel>
</investment>
</product>
and would like to reformat/reorganize the (product) tags (using Linq) to
<products>
<product number="241">
<investment number="29">
<rateLevel number="2">
<ticker>ttt</ticker>
<Cusip>1234</Cusip>
<secId>ffff</secId>
<investmentName>google</investmentName>
<marketingStatusCode/>
<marketingStatusReason/>
<tiers>
<tier>R6</tier>
</tiers>
</rateLevel>
</investment>
<investment number="28">
<rateLevel number="3">
<ticker>bbb</ticker>
<Cusip>233</Cusip>
<secId>tiee</secId>
<investmentName>apple</investmentName>
<marketingStatusCode/>
<marketingStatusReason/>
<tiers>
<tier>R2</tier>
</tiers>
</rateLevel>
</investment>
</product>
<product number="200">
<investment number="8214">
<rateLevel number="20">
<ticker>yyyy</ticker>
<Cusip>5655</Cusip>
<secId>ghos</secId>
<investmentName>microsof</investmentName>
<marketingStatusCode/>
<marketingStatusReason/>
<tiers>
<tier>Signature</tier>
</tiers>
</rateLevel>
</investment>
</product>
I have been using group by but am able to group to rateLevel tag but after that I get repeated tags. Please help.
Thanks in advance.