    # File lib/nokogiri/xml/document.rb, line 90
            def parse string_or_io, url = nil, encoding = nil, options = ParseOptions::DEFAULT_XML, &block

              options = Nokogiri::XML::ParseOptions.new(options) if Fixnum === options
              # Give the options to the user
              yield options if block_given?

              if string_or_io.respond_to?(:read)
                url ||= string_or_io.respond_to?(:path) ? string_or_io.path : nil
                return self.read_io(string_or_io, url, encoding, options.to_i)
              end

              # read_memory pukes on empty docs
              return self.new if string_or_io.nil? or string_or_io.empty?

              self.read_memory(string_or_io, url, encoding, options.to_i)
            end