ORA-31011: XML parsing failed LPX-00217: invalid character error can be a bug
If you get the error below:
ORA-31011: XML parsing failed
ORA-19202: Error occurred in XML processing
LPX-00217: invalid character
from code running on Oracle 184.108.40.206 and 220.127.116.11 and it used to work on previous versions then stop and check MOS 1391688.1. It can save you a lot of time. The reason you get this error can be bug 11877267.
I hit this bug on Oracle 18.104.22.168 during investigation why a PL/SQL piece of code that parses XMLTYPE was not working. The reason is the new XML parser introduced with 22.214.171.124.
You can either apply patch 11877267 or use the workaround to set back the old XML parser as of version 126.96.36.199.
alter system set event=’31156 trace name context forever, level 0×400′ scope=spfile;