def add_to_roster(display_name=nil,groups=[])
      item_fields = {:jid => jid.bare}
      item_fields[:name] = display_name if display_name

      query = connection.iq_stanza({:type => 'set'},
				x('query',{:xmlns => Roster},
					x('item',item_fields),
					groups.map { |grp| x('group',grp) }
				)
			)

      send_iq_stanza_fibered query
    end
def add_to_roster(display_name=nil,groups=[])
      item_fields = {:jid => jid.bare}
      item_fields[:name] = display_name if display_name

      query = connection.iq_stanza({:type => 'set'},
				x('query',{:xmlns => Roster},
					x('item',item_fields),
					groups.map { |grp| x('group',grp) }
				)
			)

      send_iq_stanza_fibered query
    end
add the entity (bare) to the roster
 optional parameters can set the display name (or friendly name)
 for the roster entity

 similarly, you can attach the entity to one or multiple groups