in reply to How to convert <,&,>,",' into XML <,&,>," ..
May be the following conversion will satisfy you
$xml_native =~ s/([^\w\s])/'&#'.ord($1).';'/ge; [download]