contacts.clear();
Document doc = XMLParser.parse(xml);
Element query = XMLHelper.queryTag(doc.getDocumentElement());
if(query !=null && query.getAttribute("xmlns").equals("jabber:iq:roster"))
{
NodeList itemList = query.getElementsByTagName("item");
for(int index = 0;index<itemList.getLength();index++)
{
Element item = (Element)itemList.item(index);
XmppContact contact = XmppContact.fromXml(item);
contacts.put(contact.getJID().toString(), contact);
}
}
if(!contacts.isEmpty())