In Oracle the XMLTYPE function allows you to built XML element from a string. In PostgreSQL you can use the XMLPARSE function.
Oracle:
-- Single XML element SELECT XMLTYPE('<employee>John</employee>') FROM dual;
PostgreSQL:
-- Single XML element SELECT XMLPARSE(CONTENT '<employee>John</employee>');
You can also build a complete XML element as follows:
Oracle:
-- Complete XML document SELECT XMLTYPE('<?xml version="1.0"?><document><employee>John</employee></document>') FROM dual;
PostgreSQL:
-- Complete XML document SELECT XMLPARSE(DOCUMENT '<?xml version="1.0"?><document><employee>John</employee></document>');
For more information, see Oracle to PostgreSQL Migration.