public String generateXML() {

		// Fisierul XML se va genera intr-un folder separat de cel cu executabilele
		String thisXMLPath = getXMLFolder() + "\\" + getName() + id + ".xml";

		// Se ia fiecare parametru si se trece in tag-uri
		File file = new File(thisXMLPath);

		try {
			file.createNewFile();
		} catch (IOException ex) {
			Logger.getLogger(Operation.class.getName()).log(Level.SEVERE, null,
					ex);
		}

		BufferedWriter writer;
		try {

			writer = new BufferedWriter(new FileWriter(file));

			// Se urmareste structura documentului

			// Tag-ul task
			writer.write("<" + getRootElement() + ">");

			writer.newLine();
			writer.write('\t');
			writer.write("<" + getRootDescription() + ">");

			// Descrierea executabilului
			for (Map.Entry<String, String> entry : getDescription().entrySet()) {

				writer.newLine();
				writer.write('\t');
				writer.write('\t');
				writer.write("<" + entry.getKey() + ">" + entry.getValue()
						+ "</" + entry.getKey() + ">");
			}

			writer.newLine();
			writer.write("</" + getRootDescription() + ">");

			// Lista de parametri

			for (SimpleTypeParameter param : getParameters()) {

				// Daca elementul e de tip simplu
				if (!(param instanceof ComplexTypeParameter)) {

					writer.newLine();
					writer.write('\t');
					writer.write("<" + param.getName() + ">");
					writer.write(param.getValue());
					writer.write("</" + param.getName() + ">");
				} 
				// Daca este element de tip complex
				else {

					writer.newLine();
					writer.write('\t');

					ComplexTypeParameter complexParam = (ComplexTypeParameter) param;

					// Tag-ul

					writer.write("<" + complexParam.getName());

					// Atributele

					ArrayList<Attribute> attributes = complexParam
							.getAttributes();

					for (Attribute attribute : attributes) {

						/* 
						 * Daca valoarea atributului nu este nula, inseamna ca:
						 * 1. este required
						 * 2. nu este required, dar valoarea lui a fost completata in fereastra de parametri
						 */
						if (attribute.getValue() != null) {
							writer.write(" " + attribute.getName() + "=" + "\""
									+ attribute.getValue() + "\"");
						}
					}

					writer.write(">");

					/*
					 *  Se scrie valoarea efectiva a parametrului;
					 * daca tag-ul e de tip empty, atunci inseamna ca valoarea e null si nu se afiseaza nimic
					 */

					if (complexParam.getValue() != null) {

						writer.write(complexParam.getValue());
					}

					writer.write("</" + complexParam.getName() + ">");
				}
			}

			writer.newLine();
			writer.write("</" + getRootElement() + ">");

			writer.close();

		} catch (IOException ex) {
			Logger.getLogger(Operation.class.getName()).log(Level.SEVERE, null,
					ex);
		}

		return thisXMLPath;
	}