public void exportTMX(String path, String extention) throws IOException {
		StringBuilder seg1 = new StringBuilder();
		StringBuilder seg2 = new StringBuilder();

		path = checkPath(path, extention);

		try {
			OutputStream fout = new FileOutputStream(path);
			OutputStream bout = new BufferedOutputStream(fout);
			OutputStreamWriter output = new OutputStreamWriter(bout, "UTF-8");

			output.write("<tmx version=\"1.4\">\r\n\r\n");

			// ispis headera
			temp = "<header\t" + "creationtool=" + "\"" + "Coral" + "\"\r\n"
					+ "\t" + "creationtoolversion=" + "\"" + "v1.0" + "\"\r\n"
					+ "\t" + "datatype=" + "\"" + "plaintext" + "\"\r\n" + "\t"
					+ "segtype=" + "\"" + "block" + "\"\r\n" + "\t"
					+ "adminlang=" + "\"" + System.getProperty("user.language")
					+ "\"\r\n" + "\t" + "srclang=" + "\""
					+ dataModel.getProperty("language1") + "\"\r\n" + "\t"
					+ "o-tmf=" + "\"" + "xml" + "\">\r\n" + "</header>\r\n\r\n";
			output.write(temp);

			// body
			output.write("<body>\r\n");

			for (int i = 0; i < idList1.size(); i++) {

				if (dataModel.getConnections(idList1.get(i)).isEmpty()) {
					continue;
				}

				// prolazi se kroz lijevu listu
				if (!visited.contains(idList1.get(i))) {
					// traze se parovi od trenutnog elementa iz lijeve liste
					goDeep(idList1.get(i));

					// vrsi se sortiranje dohvacenih parova ovisno o tome kojoj
					// listi izvorno pripadaju
					// takoder, ako se radi o visestrukim vezama elementi se
					// spajaju
					for (int j = 0; j < tuvPair.size(); j++) {
						if (idList1.contains(tuvPair.get(j))) {
							seg1.append(dataModel.getElement(tuvPair.get(j))
									+ " ");
						} else if (idList2.contains(tuvPair.get(j))) {
							seg2.append(dataModel.getElement(tuvPair.get(j))
									+ " ");
						}

					}

					// stvara se novi translation unit
					output.write("\t" + "<tu>\r\n");

					// prethodno spojeni elementi ispisuju se u translation unit
					// variant
					output.write("\t" + "<tuv xml:lang=" + "\""
							+ dataModel.getProperty("language1") + "\""
							+ "><seg>" + seg1.toString().trim()
							+ "</seg></tuv>\r\n");
					output.write("\t" + "<tuv xml:lang=" + "\""
							+ dataModel.getProperty("language2") + "\""
							+ "><seg>" + seg2.toString().trim()
							+ "</seg></tuv>\r\n");

					output.write("\t" + "</tu>\r\n\r\n");

					tuvPair.clear();
					seg1.delete(0, seg1.length());
					seg2.delete(0, seg2.length());
				}
			}

			output.write("</body>");
			output.write("</tmx>");

			output.close();
			visited.clear();

		} catch (FileNotFoundException e) {
			throw new FileNotFoundException(
					"File could not be found!\r\n"
							+ "- Verify that the file exists in the specified location.\r\n"
							+ "- Check the spelling of the name of the document.\r\n\r\n"
							+ path);
		} catch (UnsupportedEncodingException e) {
			throw new UnsupportedEncodingException("Selected encoding is not supported.");
		} catch (IOException e) {
			throw new IOException("I/O exception has occurred.");
		}
	}