public static function isXML($data) { $xml = @simplexml_load_string($data); return $xml instanceof \SimpleXmlElement; }