<Sections>
<Products>
<Transport>
<TransportSequence>1</TransportSequence>
<Traveller>001</Traveller>
</Transport>
<Transport>
<TransportSequence>2</TransportSequence>
<Traveller>001</Traveller>
</Transport>
</Products>
</Sections>
<Sections>
<Products>
<Transport>
<TransportSequence>1</TransportSequence>
<Traveller>002</Traveller>
</Transport>
<Transport>
<TransportSequence>2</TransportSequence>
<Traveller>002</Traveller>
</Transport>
</Products>
</Sections>
I have a specific problem with the ordering of some XML. From the above example I need to change the format so that I select distinct only on the TransportSequence. I then need to assign any 'Traveller' nodes as children to produce something like this:
<Sections>
<Products>
<Transport>
<TransportSequence>1</TransportSequence>
<Travellers>
<Traveller>001</Traveller>
<Traveller>002</Traveller>
</Travellers>
</Transport>
<Transport>
<TransportSequence>2</TransportSequence>
<Travellers>
<Traveller>001</Traveller>
<Traveller>002</Traveller>
</Travellers>
</Transport>
</Products>
</Sections>
The other problem is that in the Transport node also contains lots of children and grandchildren nodes not shown in this example. There can also be many travllers belonging to a TravellerSequence. There are also many TransportSequence numbers.