public void addCategory(Category c){
		try {
			String filepath = System.getProperty("user.home")
					+ "/.TODO-group9/savedata.xml";

			DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();
			DocumentBuilder docBuilder = docFactory.newDocumentBuilder();
			Document doc = docBuilder.parse(filepath); //

			Node categorys = doc.getElementsByTagName("categorys").item(0);
			NodeList categoryList = doc.getElementsByTagName("category");


			for(int i = 0; i < categoryList.getLength(); i++) {
				String n = ((Element)categoryList.item(i)).getAttribute("name");
				if (n.equals(c.getName())) {
					NamedNodeMap attr = categoryList.item(i).getAttributes();
					Node nodeRed = attr.getNamedItem("red");
					nodeRed.setTextContent("" + c.getColor().getRed());;
					Node nodeGreen = attr.getNamedItem("green");
					nodeGreen.setTextContent("" + c.getColor().getGreen());;
					Node nodeBlue = attr.getNamedItem("blue");
					nodeBlue.setTextContent("" + c.getColor().getBlue());;
				}
			}

			Element category = doc.createElement("category");
			categorys.appendChild(category);

			Element name = doc.createElement("name");
			name.appendChild(doc.createTextNode(c.getName()));
			category.appendChild(name);

			Element red = doc.createElement("red");
			String x = "" + c.getColor().getRed();
			red.appendChild(doc.createTextNode(x));
			category.appendChild(red);

			Element green = doc.createElement("green");
			String y = "" + c.getColor().getGreen();
			green.appendChild(doc.createTextNode(y));
			category.appendChild(green);

			Element blue = doc.createElement("blue");
			String z = "" + c.getColor().getBlue();
			blue.appendChild(doc.createTextNode(z));
			category.appendChild(blue);

			TransformerFactory transformerFactory = TransformerFactory.newInstance();
			Transformer transformer = transformerFactory.newTransformer();

			DOMSource source = new DOMSource(doc);
			StreamResult result = new StreamResult(new File(filepath));
			transformer.transform(source, result); //

		} catch (ParserConfigurationException pce) {
			pce.printStackTrace();
		} catch (TransformerException tfe) {
			tfe.printStackTrace();
		} catch (IOException ioe) {
			ioe.printStackTrace();
		} catch (SAXException sae) {
			sae.printStackTrace();
		}
	}