private void handleIQBindTag() throws IOException, XMLStreamException {

		// DEBUG
		System.out.println("Handling server's IQ Bind tag");

		// Flag to indicate that we have finished parsing the
		// IQ Bind tag
		boolean done = false;

		while (!done) {

			// Get the next XML event
			int eventType = parser.next();

			// Check if the parse event is a XML start tag
			if (eventType == XMLStreamConstants.START_ELEMENT) {

				// Case 1: JID tag
				if (parser.getLocalName().equals("jid")) {

					// Get and set the resource ID sent by the server
					String fullJID = parser.getElementText();
					String[] split = fullJID.split("/");
					if (split.length != 2) {
						throw new IOException(
								"Ill-formatted JID sent by server: " + fullJID);
					}
					jid.setResource(split[1]);

					// DEBUG
					System.out.println("Obtained Resource ID: "
							+ jid.getJabberID() + "/" + jid.getResource());
				}
			} else if (eventType == XMLStreamConstants.END_ELEMENT) {
				if (parser.getLocalName().equals("bind")) {
					done = true;
				} else if (parser.getLocalName().equals("query")) {
					done = true;
				}
			}
		}
	}