public static XMLNode parseText(String text) throws EOFException {
			XMLNode currentNode = new XMLNode();
			char[] c = text.toCharArray();
			for (int i = 0; i < c.length; i++) {
				if (c[i] == '/') {
					if (currentNode.getParent().getName() == null)
						return currentNode;
					currentNode = currentNode.getParent();
				}
				if ((c[i] == '<') && (c[(i + 1)] != '/')) {
					String tagText = text.substring(i + 1);
					XMLNode newNode = new XMLNode();
					currentNode.addChild(newNode);
					currentNode = newNode;
					currentNode.setName(tagText.substring(0,
							tagText.indexOf(">")).split(" ")[0]);
					int tagEnd = min(tagText.indexOf(">"), tagText.indexOf("/"));

					String attribText = tagText.substring(0, tagEnd);
					for (String currentAttribute : attribText.split(" ")) {
						if (currentAttribute.split("=").length >= 2)
							currentNode.addAttribute(currentAttribute
									.split("=")[0],
									currentAttribute.split("=")[1].replace(
											"\"", ""));
					}
					i = i + tagEnd - 1;
				}
			}

			throw new EOFException("Nodes aren't closed properly");
		}