public void removeTask(Task t) {

		try {
			String filepath = System.getProperty("user.home")
					+ "/.TODO-group9/savedata.xml";
			DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();
			DocumentBuilder docBuilder = docFactory.newDocumentBuilder();
			Document doc = docBuilder.parse(filepath);

			int itemID = t.getId();
			Node taskList = doc.getElementsByTagName("tasklist").item(0);
			NodeList list = doc.getElementsByTagName("task");

			for (int i = 0; i < list.getLength(); i++) {
				Node node = list.item(i);

				if ((""+ itemID).equals(((Element) node).getAttribute("id"))) {
					taskList.removeChild(node);
				}

			}

			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();
		}
	}