Escape XML node value

if(!function_exists('escape_xml_value')){
    function escape_xml_value($str){
        $str = htmlspecialchars($str, ENT_XML1, 'UTF-8');

        return $str;
    }
}