final IQ iq = new IQ(IQ.Type.set);
final XMLPacket vcard = iq.addExtension(VCARD, XMLNS);
vcard.setAttribute("xdbns", XMLNS);
vcard.setAttribute("prodid", "-//HandGen//NONSGML vGen v1.0//EN");
vcard.setAttribute("version", "2.0");
vcard.addChild(PHOTO, null).addChild(BINVAL, null).setText(photoBinary);
session.sendIQ("avatar", iq, new IQCallback() {
@Override
public void onIQSuccess(final IQ iq) {
// TODO: add behaviour
}