public void save() {
		try {

			Document d;

			d = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();

			Transformer t = TransformerFactory.newInstance().newTransformer();

			Element rootElement = d.createElement("dssSave");

			Element statsElement = d.createElement("stats");
			for (Stat stat : dataModel.getStats()) {
				Element statElement = d.createElement("stat");
				Element statTagElement = d.createElement("tag");
				statTagElement.setTextContent(stat.getTag());
				Element statValueElement = d.createElement("value");
				statValueElement.setTextContent(Integer.toString(stat.getValue()));

				statElement.appendChild(statTagElement);
				statElement.appendChild(statValueElement);
				statsElement.appendChild(statElement);
			}
			
			Element skillsElement = d.createElement("skills");
			for (Skill skill: dataModel.getSkills()) {
				Element skillElement = d.createElement("skill");
				Element skillTagElement = d.createElement("tag");
				skillTagElement.setTextContent(skill.getTag());
				Element skillValueElement = d.createElement("value");
				skillValueElement.setTextContent(Integer.toString(skill.getValue()));

				skillElement.appendChild(skillTagElement);
				skillElement.appendChild(skillValueElement);
				skillsElement.appendChild(skillElement);
			}

			Element selectedAbilitiesElement = d.createElement("selectedAbilities");
			for (Ability ability : dataModel.getSelectedAbilities()) {
				Element abilityElement = d.createElement("ability");
				Element abilityTagElement = d.createElement("tag");
				abilityTagElement.setTextContent(ability.getTag());

				abilityElement.appendChild(abilityTagElement);
				selectedAbilitiesElement.appendChild(abilityElement);
			}

			rootElement.appendChild(statsElement);
			rootElement.appendChild(skillsElement);
			rootElement.appendChild(selectedAbilitiesElement);

			d.appendChild(rootElement);

			t.setOutputProperty(OutputKeys.INDENT, "yes");
			t.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "4");

			FileOutputStream s = new FileOutputStream("save.xml");

			t.transform(new DOMSource(d), new StreamResult(s));

			s.close();

		} catch (ParserConfigurationException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (TransformerConfigurationException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (TransformerFactoryConfigurationError e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (TransformerException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (FileNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}