I'm generating XML document from PHP script and I need to escape the XML special characters... I know the list of characters that should be escaped, but what is the correct way to do it?
Should the characters be escaped just with backslash (\') or what is the proper way? Is there any builtin function in PHP that can handle this for me?