Every IDREFS or NMTOKENS column in a FOR XML EXPLICIT query must appear in a separate SELECT clause, and the instances must be ordered directly after the element to which they belong.
The schema may not have sufficient key fields specified.
This can be resolved by adding sql:key-fields annotation.