public List<Component> loadDatabase(){
		List<Component> database = new ArrayList<Component>();

		try {

			File fXmlFile = new File("database.xml");
			DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
			DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();
			Document doc = dBuilder.parse(fXmlFile);
			doc.getDocumentElement().normalize();

			Node root = (Node) doc.getDocumentElement();
			System.out.println("Root element :" + root.getNodeName());

			System.out.println("-----------------------");

			NodeList nList = root.getChildNodes();

			for (int temp = 0; temp < nList.getLength(); temp++) {

				Node nNode = nList.item(temp);	    
				if (nNode.getNodeType() == Node.ELEMENT_NODE) {

					Element eElement = (Element) nNode;

					if(eElement.getNodeName().equals("job")){
						Job job = createJob(eElement);
						database.add(job);

					}
					else if(eElement.getNodeName().equals("task")){
						Task task = new Task(eElement.getAttribute("name"), eElement.getAttribute("description"), eElement.getAttribute("state"));
						NodeList intervals = eElement.getChildNodes();

						for(int i = 0; i < intervals.getLength(); i++){
							Node interval = intervals.item(i);	    
							if (interval.getNodeType() == Node.ELEMENT_NODE){
								Element intvl = (Element) interval;

								Interval newInterval = new Interval(intvl.getAttribute("start"),intvl.getAttribute("end"));
								task.getIntervals().add(newInterval);
							}
						}
						database.add(task);
					}
					else if(eElement.getNodeName().equals("action")){
						Action action = new Action(eElement.getAttribute("name"), eElement.getAttribute("description"), eElement.getAttribute("state"));
						database.add(action);
					}
				}
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
                
                return database;
	}