public static LinkedList<CartsModel> XmlExport(SchedSystem ss) {

		Document doc;

		try {
			doc = XmlReader.getDoc("carts/xml/output.xml");
		} catch (ParserConfigurationException | SAXException | IOException e1) {
			e1.printStackTrace();
			return null;
		}

		// TODO THHHHHHHOOOOOOOOOOOOOOOOORRRRRRRRRRRRRRRRRRRRR
		Node SUPER_NODE = doc.getChildNodes().item(0);
		NodeList SUPER_NODE_CHILDS = SUPER_NODE.getChildNodes();

		NamedNodeMap temp = SUPER_NODE.getAttributes();
		// String name = temp.getNamedItem("name").getNodeValue();
		String algo = temp.getNamedItem("algorithm").getNodeValue();
		// System.out.println("name: " + name);
		// System.out.println("algo: " + algo);

		NodeList resource = SUPER_NODE_CHILDS.item(1).getChildNodes();
		NodeList proc_task = SUPER_NODE_CHILDS.item(3).getChildNodes();
		String[] component_name = new String[ss.numberOfPartitions()];
		NodeList[] component_resource = new NodeList[ss.numberOfPartitions()];
		NodeList[] component_proc_task = new NodeList[ss.numberOfPartitions()];

		for (int i = 0; i < ss.numberOfPartitions(); i++) {
			component_name[i] = SUPER_NODE_CHILDS.item(5 + i * 2)
					.getAttributes().getNamedItem("name").getNodeValue();
			component_resource[i] = SUPER_NODE_CHILDS.item(5 + i * 2)
					.getChildNodes().item(1).getChildNodes();
			component_proc_task[i] = SUPER_NODE_CHILDS.item(5 + i * 2)
					.getChildNodes().item(3).getChildNodes();
		}

		LinkedList<CartsModel> ret = new LinkedList<CartsModel>();

		for (int i = 0; i < resource.getLength(); i++) {
			// System.out.println(resource.item(i).getNodeName() + " " +
			// resource.item(i).hasAttributes());
			// Node curr = resource.item(i);
			// if (curr.hasAttributes()) {
			// NamedNodeMap lol = curr.getAttributes();
			// System.out.println(lol.getNamedItem("period"));
			// System.out.println(lol.getNamedItem("bandwidth"));
			// System.out.println(lol.getNamedItem("deadline"));
			// }
			if (resource.item(i).hasAttributes()) {

				// PhDs that dont know how to ouput xml correctly...
				double model_bandwith;
				try {
					model_bandwith = Double.valueOf(resource.item(i)
							.getAttributes().getNamedItem("bandwidth")
							.getNodeValue());
				} catch (NumberFormatException e) {
					int tempn = Integer.valueOf(resource.item(i)
							.getAttributes().getNamedItem("bandwidth")
							.getNodeValue());
					model_bandwith = Double.valueOf(tempn);
				}

				// bandwith is the system utilization factor
				if (model_bandwith < (Airsched.getUtilizationThreshold() / 100.0)) {
					// System.out.println("tou aki!!! " + i + " xxx "+
					// model_bandwith);

					int model_period = Integer.valueOf(resource.item(i)
							.getAttributes().getNamedItem("period")
							.getNodeValue());

					int model_execution = Integer.valueOf(proc_task.item(i)
							.getAttributes().getNamedItem("execution_time")
							.getNodeValue());

					CartsModel cm = new CartsModel(algo, model_period,
							model_execution, model_bandwith);

					// parse components
					for (int j = 0; j < component_resource.length; j++) {

						double component_model_bandwith;
						try {
							component_model_bandwith = Double
									.valueOf(component_resource[j].item(i)
											.getAttributes()
											.getNamedItem("bandwidth")
											.getNodeValue());
						} catch (NumberFormatException e) {
							int tempn = Integer.valueOf(component_resource[j]
									.item(i).getAttributes()
									.getNamedItem("bandwidth").getNodeValue());
							component_model_bandwith = Double.valueOf(tempn);
						}

						int component_model_period = Integer
								.valueOf(component_resource[j].item(i)
										.getAttributes().getNamedItem("period")
										.getNodeValue());

						int component_model_execution = Integer
								.valueOf(component_proc_task[j].item(i)
										.getAttributes()
										.getNamedItem("execution_time")
										.getNodeValue());

						CartsComponent new_comp = new CartsComponent(
								component_name[j], algo,
								PartitionUtils.getCriticalityByName(
										component_name[j], ss.getPartitions()),
								component_model_period,
								component_model_execution,
								component_model_bandwith);

						cm.addComponent(new_comp);
					}

					// System.out.println("TOU AKI");
					ret.add(cm);
				}
			}
		}

		System.out.println(ret.size());
		return ret;
	}