if($string=~/[\x00-\x1F]+/) { # here, I want to replace the non-printable characters by printable characters which shouldn't cause any problem to XML::Writer emptyTag function. }