# File lib/nokogiri/xml/schema.rb, line 49
      def validate thing
        return validate_document(thing) if thing.is_a?(Nokogiri::XML::Document)

        # FIXME libxml2 has an api for validating files.  We should switch
        # to that because it will probably save memory.
        validate_document(Nokogiri::XML(File.read(thing)))
      end