public static function toXmlCompliant($str, $striptags = true)
    {
        if (true === $striptags) {
            $str = strip_tags($str);
        }
        $str = html_entity_decode($str, ENT_COMPAT, 'UTF-8');
        $str = str_replace(array('<', '>', '&'), array('&lt;', '&gt;', '&amp;'), $str);

        return $str;
    }