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 188.8.131.52 and 184.108.40.206 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 220.127.116.11 during investigation why a PL/SQL piece of code that parses XMLTYPE was not working. The reason is the new XML parser introduced with 18.104.22.168.
You can either apply patch 11877267 or use the workaround to set back the old XML parser as of version 22.214.171.124.
alter system set event=’31156 trace name context forever, level 0×400′ scope=spfile;