Oracle Error ORA-31059: Cannot insert root XML document node if it already exists

Oracle Error Message

ORA-31059: Cannot insert root XML document node if it already exists

Reason for the Error

An attempt was made to insert a root node into an XML document that already had a root node.

Solution

Call the appropriate replace function to replace the node instead of inserting it anew.