public static function isXml($data) {
        // Do manually checks on the string since HHVM blows up
        if (!is_string($data) || substr($data, 0, 5) !== '<?xml') {
            return false;
        }

        return (@simplexml_load_string($data) instanceof SimpleXMLElement);
    }
public static function isXml($data) {
        // Do manually checks on the string since HHVM blows up
        if (!is_string($data) || substr($data, 0, 5) !== '<?xml') {
            return false;
        }

        return (@simplexml_load_string($data) instanceof SimpleXMLElement);
    }
public static function isXml ( $ data ) { // Do manually checks on the string since HHVM blows up if ( ! is_string ( $ data ) || substr ( $ data , 0 , 5 ) !== '<?xml' ) { return false ; } return ( @ simplexml_load_string ( $ data ) instanceof SimpleXMLElement ) ; }
Check to see if data passed is an XML document.

@param mixed $data
@return bool
Check to see if data passed is an XML document .