Oracle Solution for Error ora-19028

Solution for Oracle Error ORA-19028

ORA-19028: Invalid ADT parameter passed to toObject() function

What triggered the Error:

The object passed as ADT parameter to sys.XMLType.toObject() is not the same type, or a super-type, of the mapped type.

What should we do to fix it:

Pass an object of the correct type to toObject().