I’m wondering if there is a way to flip the hierarchy of node using linq to XML or xslt.
I’m want to transform
<hardware>
<software/>
<software/>
</hardware>
<hardware>
<software/>
<software/>
</hardware>
Where I use the existing parent – child relationship and just flip and rebuild the structure to look like this.
<software>
<hardware/>
<hardware/>
</software>
<software>
<hardware/>
<hardware/>
</software>
Yes. This transformation:
when applied on this XML document:
produces the wanted, correct result:
Explanation: Muenchian method for grouping.