"Escaped form" isn't something that exists as a generic term. If you
want a string escaped, you're going to have to use some string escape
function of whatever it is you're trying to escape for; e.g., the
database or XML library you're using (you *are* using a library to
generate a structured format, are you?). Otherwise you're going down the
PHP "addslashes" pitfall, which won't help you nor anyone else.