# File lib/flickr/groups.rb, line 7
        def browse(category=nil)
                category=category.id if (category.class == Flickr::Category ||
                        category.class == Flickr::SubCategory )

                args = category ?  {'cat_id' => category } : {}
                res = @flickr.call_method('flickr.groups.browse',args)
                att = res.root.attributes
                cat=Flickr::Category.new(att['name'],att['path'],att['pathids'])
                res.elements['/category'].each_element('subcat') do |e|
                        att = e.attributes
                        cat.subcats << Flickr::SubCategory.new(att['name'],
                                att['id'],att['count'].to_i)
                end
                res.elements['/category'].each_element('group') do |e|
                        att = e.attributes
                        nsid = att['nsid']

                        g = @flickr.group_cache_lookup(nsid)
                        g ||= Flickr::Group.new(@flickr,nsid)

                        g.name = att['name']
                        g.members = att['members'].to_i
                        g.online = att['online'].to_i
                        g.chatnsid = att['chatnsid']
                        g.inchat = att['inchat'].to_i

                        @flickr.group_cache_store(g)
                        cat.groups << g
                end

                return cat
        end