# File lib/metacat.rb, line 161
  def logout
    response = metacat_get({
      'action'    =>  'logout',
      'qformat'   =>  'xml'
    })
    if(response.content_type == 'text/xml')
      doc = REXML::Document.new(response.read_body)
      if doc.root.name = 'logout'
        @cookie = false
        return true
      else
        raise 'Failed to logout: '+doc.root.text
      end
    else
      raise MetacatResponseError
    end    
  end