private void addStudentToDB(Student student) throws ServerException {
		if (log.isDebugEnabled())
			log.debug("Method call. Arguments: " + student);
		NodeList groups = document.getElementsByTagName("group");
		Element group = null;
		Element students = null;
		for (int i = 0; i < groups.getLength(); i++) {
			if (groups.item(i).getAttributes().getNamedItem("number")
					.getNodeValue().equals(student.getGroupNumber())) {
				group = (Element) groups.item(i);
				students = (Element) group.getElementsByTagName("students")
						.item(0);
				break;
			}
		}
		if (group == null) {
			ServerException ex = new ServerException("Group with number "
					+ student.getGroupNumber() + " does not exist");
			log.error("Exception", ex);
			throw ex;
		} else if (students == null) {
			ServerException ex = new ServerException(
					"Can not add student to group with number "
							+ student.getGroupNumber());
			log.error("Exception", ex);
			throw ex;
		}
		Element studentNode = document.createElement("student");
		studentNode.setAttribute("id", new Integer(student.getId()).toString());
		studentNode.setAttribute("firstname", student.getFirstName());
		studentNode.setAttribute("lastname", student.getLastName());
		studentNode.setAttribute("groupnumber", student.getGroupNumber());
		studentNode.setAttribute("enrolled", student.getEnrolled());
		group.appendChild(students);
		students.appendChild(studentNode);
	}