php xml string code example
Example 1: xml to object php
$object = json_decode(json_encode(simplexml_load_string($xml)));
Example 2: php xml string
htmlspecialchars($string, ENT_XML1 | ENT_QUOTES, 'UTF-8');// will convert ' to ' in addition to &, <, > and "( not | )