public static ProtocolResultFromServer getProtocolResultFromServer(
			String inString) throws JDOMException, IOException,
			TagFormatException {
		ProtocolResultFromServer result = new ProtocolResultFromServer();
		SAXBuilder mSAXBuilder = new SAXBuilder();
		Document mDocument = mSAXBuilder.build(new StringReader(inString));
		Element rootNode = mDocument.getRootElement();
		String protType = rootNode.getName();

		if (protType.equals(Tags.SESSION_DENY_S)) {
			result.setStatus(false);
		} else if (protType.equals(Tags.SESSION_ACCEPT)) {

			result.setStatus(true);

			ArrayList<ClientContact> contacts = new ArrayList<ClientContact>();

			@SuppressWarnings("unchecked")
			List<Element> listOfPeers = rootNode.getChildren(Tags.PEER);
			for (int i = 0; i < listOfPeers.size(); i++) {

				Element node = listOfPeers.get(i);

				String name = node.getChildText(Tags.PEER_NAME);
				String ip = node.getChildText(Tags.IP);
				int port = Integer.parseInt(node.getChildText(Tags.PORT));

				contacts.add(new ClientContact(name, ip, port));
			}

			result.setClientContacts(contacts);
		} else {
			TagFormatException tfe = new TagFormatException(
					"It's not a result of sign up request chat protocol");
			throw tfe;
		}
		return result;
	}