Oracle Solution for Error ora-31059

Solution for Oracle Error ORA-31059

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

What triggered the Error:

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

What should we do to fix it:

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