void save() {
		Document doc = new Document();
		Element root = new Element("sessions");
		doc.addContent(root);

		final int sessionCount = this.getSessionCount();
		for (int i = 0; i < sessionCount; i++) {
			Session s = this.getSession(i);

			Element elementSession = new Element("session");

			Element elementId = new Element("id");
			elementId.setText(String.valueOf(s.getId()));
			elementSession.addContent(elementId);

			Element elementType = new Element("type");
			elementType.setText(String.valueOf(s.getProtocol()));
			elementSession.addContent(elementType);

			Element elementName = new Element("name");
			elementName.setText(s.getName());
			elementSession.addContent(elementName);

			Element elementServeur = new Element("server");
			elementServeur.setText(s.getServer());
			elementSession.addContent(elementServeur);

			Element elementLogin = new Element("login");
			elementLogin.setText(s.getLogin());
			elementSession.addContent(elementLogin);

			Element elementPassword = new Element("password");
			elementPassword.setText(s.getPassword());
			elementSession.addContent(elementPassword);

			Element elementCardRequired = new Element("cardRequired");
			elementCardRequired.setText(s.isCardRequired() ? "true" : "false");
			elementSession.addContent(elementCardRequired);

			Element elementCardRestricted = new Element("cardRestricted");
			elementCardRestricted.setText(s.isFilterCard() ? "true" : "false");
			elementSession.addContent(elementCardRestricted);

			Element elementClientRestricted = new Element("clientRestricted");
			elementClientRestricted.setText(s.isFilterClient() ? "true"
					: "false");
			elementSession.addContent(elementClientRestricted);

			List<Card> cards = s.getAllowedCards();
			for (Card card : cards) {
				Element elementCard = new Element("allowedCardId");
				elementCard.setText(card.getId());
				elementSession.addContent(elementCard);
			}
			List<ThinClient> clients = s.getAllowedClients();
			for (ThinClient client : clients) {
				Element elementClient = new Element("allowedClientId");
				elementClient.setText(client.getSerialNumber());
				elementSession.addContent(elementClient);
			}

			//
			Element elementHardwareCursorUsed = new Element(
					"hardwareCursorUsed");
			elementHardwareCursorUsed.setText(s.isHardwareCursorUsed() ? "true"
					: "false");
			elementSession.addContent(elementHardwareCursorUsed);

			root.addContent(elementSession);
		}

		FileOutputStream fOp;
		try {
			fOp = new FileOutputStream(f);
			// Raw output
			XMLOutputter outp = new XMLOutputter();
			outp.output(doc, fOp);
			fOp.close();
		} catch (Exception ex) {
			ex.printStackTrace();
		}

	}