Problem:
XML - node is unfer the wrong parent
Cause and solution:
Check that the node is one of the items of the 'Order By', and check the order. The XML query should be sorted by the key nodes.
The copy-pastes and explanations blog for SQL code, errors and daily cases! This blog is a 'list' of actions that always good to have available. The copy-paste concept here is short and clear explanations and descriptions (no long stories!) and - of course - the code to take (copy) and use (paste). The blog deals in the database (mostly) and software issues.