public static RegistrationData parseFromXmlElement (Element elem) {
		String regId = elem.getAttribute("id");
		String courseId = elem.getAttribute("courseid");
		
		
		RegistrationData data = new RegistrationData();
		data.setRegistrationId(regId);
		data.setCourseId(courseId);
		
		ArrayList instances = data.getInstances();
		NodeList instancesList = elem.getElementsByTagName("instance");
		if(instancesList.getLength() > 0){
			for(int i = 0; i < instancesList.getLength(); i++){
				Element instance = (Element)instancesList.item(i);
				
				int instanceId, courseVersion;
				try { instanceId = Integer.parseInt( instance.getAttribute("id") ); }
				catch (Exception e) { instanceId = -1; }
				try { courseVersion = Integer.parseInt( instance.getAttribute("courseversion") ); }
				catch (Exception e) { courseVersion = -1; }

				RegistrationData.InstanceData instanceData = new RegistrationData.InstanceData();
				instanceData.setInstanceId(instanceId);
				instanceData.setCourseVersion(courseVersion);
				instances.add(instanceData);
			}
		}
		
		NodeList reportList = elem.getElementsByTagName("registrationreport");
		if(reportList.getLength() > 0){
			Element report = (Element)reportList.item(0);
			String regResults = null;
			try { regResults = XmlUtils.getXmlString(report); }
			catch (Exception e) {};
			if(regResults != null){
				data.setResultsData(regResults);
			}
		}		
		
		return data;
	}