you can replace by something like "return is_object(simplexml_load_string($output))"