WITH x AS (SELECT DBMS_XMLGEN.CONVERT(REGEXP_REPLACE(iText, \'(#[[:digit:]]+;)\', \'\\1\'), 1) AS message FROM DUAL) SELECT UTL_I18N.UNESCAPE_REFERENCE(message)into iText2 f