public static ProtocolChatMessage getProtocolChatMessage(String inString)
			throws TagFormatException, JDOMException, IOException {
		SAXBuilder mSAXBuilder = new SAXBuilder();
		Document mDocument = mSAXBuilder.build(new StringReader(inString));

		Element rootNode = mDocument.getRootElement();
		String protType = rootNode.getName();

		int type = -1;
		String content = "";
		if (protType.equals(Tags.CHAT_MSG)) {
			type = ProtocolChatMessage.CHAT_MESSAGE;
			content = rootNode.getText();
		} else if (protType.equals(Tags.FILE_REQ)) {
			type = ProtocolChatMessage.FILE_MESSAGE;
			content = rootNode.getText();
		} else if (protType.equals(Tags.FILE_REQ_NOACK_S)) {
			type = ProtocolChatMessage.FILE_NOACK;
		} else if (protType.equals(Tags.FILE_REQ_ACK)) {
			type = ProtocolChatMessage.FILE_ACK;
			content = rootNode.getChildText(Tags.PORT);
		} else {
			TagFormatException tfe = new TagFormatException(
					"It's not a chat message protocol");
			throw tfe;
		}

		return new ProtocolChatMessage(type, content);
	}