src/Core/Convert.php
public static function raw2xml($val)
    {
        if (is_array($val)) {
            foreach ($val as $k => $v) {
                $val[$k] = self::raw2xml($v);
            }
            return $val;
        }

        return htmlspecialchars($val, ENT_QUOTES, 'UTF-8');
    }
public static function raw2xml($val)
    {
        if (is_array($val)) {
            foreach ($val as $k => $v) {
                $val[$k] = self::raw2xml($v);
            }
            return $val;
        }

        return htmlspecialchars($val, ENT_QUOTES, 'UTF-8');
    }
public static function raw2xml ( $ val ) { if ( is_array ( $ val ) ) { foreach ( $ val as $ k => $ v ) { $ val [ $ k ] = self :: raw2xml ( $ v ) ; } return $ val ; } return htmlspecialchars ( $ val , ENT_QUOTES , 'UTF-8' ) ; }
Ensure that text is properly escaped for XML.

@see http://www.w3.org/TR/REC-xml/#dt-escape
@param array|string $val String to escape, or array of strings
@return array|string
Ensure that text is properly escaped for XML .