encoding special characters to avoid errors on xml file creation