​ORA-31061: XDB error: special char to escaped char conversion failed.

0

Error : ​ORA-31061: XDB error: special char to escaped char conversion failed.

Cause : This is error is due to the presence of control characters in the data 

Solution : use Regexp_replace(Data,''[[:cntrl:]]'','')  to cleanse the data

Example
select xmlelement("a", test) from (select regexp_replace(unistr('a\0013b'), '[[:cntrl:]]', '') test from dual);