protected void resolveTransitions(Element root, Map<String, Element> stateMap, Map<Element, Element> transMap) {
		for(Element state: root.getChildren(STATE_TAG)){
			
			boolean hasTimeout = false;
			for(Element trans: state.getChildren(TIMEOUT_TAG)) {
				Element target = stateMap.get(trans.getAttributeValue(TRANSITION_TARGET_TAG));
				
				if(hasTimeout)
					throw new RuntimeException("State '"+target+"' has more than one timeout");
				if(target == null) 
					throw new RuntimeException("Timeout target does not exists in '" + root.getAttributeValue(AUTOMATA_NAME_TAG) + "/"+state+"': " + trans.getAttributeValue(TRANSITION_TARGET_TAG));
				transMap.put(trans, target);
				hasTimeout = true;
			}
			
			for(Element trans: state.getChildren(TRANSITION_TAG)) {
				Element target = stateMap.get(trans.getAttributeValue(TRANSITION_TARGET_TAG));
				if(hasTimeout) {
					String timeoutval = trans.getAttributeValue(TRANSITION_TIMEOUT_TAG);
					if (timeoutval != null && Integer.parseInt(timeoutval) == TimedAutomata.INFINITY)
						throw new RuntimeException("Cannot mix timeout and infinite guars in: "+ state);
				}
				if(target == null)
					throw new RuntimeException("Target does not exists in '" + root.getAttributeValue(AUTOMATA_NAME_TAG) + "': " + trans.getAttributeValue(TRANSITION_TARGET_TAG));
				transMap.put(trans, target);
			}
		}
	}