private Element parseLoop() throws ParserException, XMLStreamException {
		String type = getAttribute("type", "test-first");
		switch (type) {
			case "test-first":
				return parseTestLoop(true);
			case "test-last":
				return parseTestLoop(false);
			case "infinite":
				return parseInfiniteLoop();
			default:
				throw new ParserException("Loop type must be 'test-first', 'test-last' or 'infinite'.");
		}
	}