public static function useInternalErrors(callable $callable)
    {
        $previousErrorReporting = error_reporting();
        error_reporting(0);
        $previousLibXmlUseInternalErrors = libxml_use_internal_errors(true);
        if ($previousLibXmlUseInternalErrors) {
            libxml_clear_errors();
        }
        $return = $callable();
        try {
            static::throwFromLibXml();
        } finally {
            error_reporting($previousErrorReporting);
            libxml_use_internal_errors($previousLibXmlUseInternalErrors);
        }
        return $return;
    }