public void questionSave(LinkedList<Question> questions) {

		try {
			Document doc = DOMfunctions.getDocument();
			Element rootElement = doc.createElement(QUESTIONS);
			doc.appendChild(rootElement);

			for (Question q : questions) {
				Element question = doc.createElement(QUESTION);
				rootElement.appendChild(question);

				Element text = doc.createElement(TEXT);
				text.appendChild(doc.createTextNode(q.getQuestion()));
				question.appendChild(text);

				Element answers = doc.createElement(ANSWERS);
				//question.appendChild(answers);
				for (Answer a : q.getAnswers()) {
					Element answer = doc.createElement(ANSWER);
					answer.appendChild(doc.createTextNode(a.getAnswer()));
					answers.appendChild(answer);
				}
				question.appendChild(answers);

				Element correct = doc.createElement(CORRECT);
				try {
					correct.appendChild(doc.createTextNode(q.getCorrect()
							.getAnswer()));
				} catch (DOMException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
				question.appendChild(correct);

				Element difficulty = doc.createElement(DIFFICULTY);
				difficulty.appendChild(doc.createTextNode(Integer.toString(q
						.getDifficulty())));
				question.appendChild(difficulty);

			}

			DOMfunctions.saveInstance(fileName, doc);

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