I'm a bit new to XSLT, but I'm trying to merge child elements of sibling nodes into a single node containing all the data.
So for example, my data structure looks something like this:
<root>
<item>
<child index="0">
<data>fooA</data>
<data>fooB</data>
<data>fooC</data>
<data>fooD</data>
</child>
<child index="1">
<data>foo1</data>
<data>foo2</data>
<data>foo3</data>
<data>foo4</data>
</child>
</item>
<item>
<child index="0">
<data>barE</data>
<data>barF</data>
<data>barG</data>
<data>barH</data>
</child>
<child index="1">
<data>bar5</data>
<data>bar6</data>
<data>bar7</data>
<data>bar8</data>
</child>
</item>
</root>
and I want to transform it like this:
<root>
<item>
<child index="0">
<data>fooA</data>
<data>fooB</data>
<data>fooC</data>
<data>fooD</data>
<data>barE</data>
<data>barF</data>
<data>barG</data>
<data>barH</data>
</child>
<child index="1">
<data>foo1</data>
<data>foo2</data>
<data>foo3</data>
<data>foo4</data>
<data>bar5</data>
<data>bar6</data>
<data>bar7</data>
<data>bar8</data>
</child>
</item>
</root>
So I think I need to somehow group by index and then just select each element, but I'm not quite sure how to do that.
Thanks in advance...