variable1 nodes cannot have variable2 node children
Cause
You attempted to insert a node of type variable1 as a child of a node of type variable2 where such insertion is not allowed. This may be occurring through an XQuery builtin, such as xdmp:insert-child, or via an XSLT transformation. One example of such invalid insertion is attempting to add an attribute or namespace node as an immediate child of a document node.
Response
Correct your code.
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.