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;
    }
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;
    }
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 ; }
Return an XML compliant form of string
@param  string  $str
@param  Boolean $striptags Are HTML tags to be striped from string
@return string  The XML compliant string
Return an XML compliant form of string