def get_ead
      if @eadid.nil? and @url.nil? and @file.nil? and @baseurl
        raise 'Cannot get EAD based on params.'
      end
      if @file and @file.is_a? File
        @file.rewind if @file.eof?
        @ead = @file.read
      elsif @url
        @ead = open(@url).read
      elsif @baseurl
        @ead = open(File.join(@baseurl, @eadid + '.xml')).read
      end
      @doc = Nokogiri::XML(@ead)
    end
def get_ead
      if @eadid.nil? and @url.nil? and @file.nil? and @baseurl
        raise 'Cannot get EAD based on params.'
      end
      if @file and @file.is_a? File
        @file.rewind if @file.eof?
        @ead = @file.read
      elsif @url
        @ead = open(@url).read
      elsif @baseurl
        @ead = open(File.join(@baseurl, @eadid + '.xml')).read
      end
      @doc = Nokogiri::XML(@ead)
    end
options include :file and :base_url