I have searched stackoverflow on this problem and did find a few topics, but I feel like there isn\'t really a solid answer for me on this.
I have a form that users
Use "htmlentities()" with flag "ENT_XML1": htmlentities($value, ENT_XML1);
htmlentities($value, ENT_XML1);
If you use "SimpleXMLElement" class:
$SimpleXMLElement->addChild($name, htmlentities($value, ENT_XML1));