public static String writeBill(Object[][] tableData) {
		try {

			DocumentBuilderFactory dBfactory = DocumentBuilderFactory
					.newInstance();
			DocumentBuilder dBuilder;

			dBuilder = dBfactory.newDocumentBuilder();

			Document doc = dBuilder.newDocument();

			Element rootElement = doc.createElement("Bill");
			doc.appendChild(rootElement);

			int datalength = (tableData == null ? 0 : tableData.length);
			if (tableData != null)
				for (int i = 0; i < datalength; i++) {
					Element item = doc.createElement("item");
					rootElement.appendChild(item);

					Element id = doc.createElement("id");
					id.appendChild(doc.createTextNode("" + tableData[i][0]));
					item.appendChild(id);

					Element name = doc.createElement("name");
					name.appendChild(doc
							.createTextNode((String) tableData[i][1]));
					item.appendChild(name);

					Element quantity = doc.createElement("quantity");
					quantity.appendChild(doc.createTextNode(""
							+ tableData[i][2]));
					item.appendChild(quantity);

					Element price = doc.createElement("price");
					price.appendChild(doc.createTextNode("" + tableData[i][3]));
					item.appendChild(price);

					Element description = doc.createElement("description");
					description.appendChild(doc.createTextNode(""
							+ (String) tableData[i][4]));
					item.appendChild(description);

				}

			TransformerFactory tFactory = TransformerFactory.newInstance();
			Transformer transformer;

				transformer = tFactory.newTransformer();
			DOMSource source = new DOMSource(doc);
			Date date = new Date();
			File dir = new File(Main.billpath);
			if (!dir.exists()) {
				dir.mkdir();
			}
			String path = (Main.billpath + (1900 + date.getYear()) + ","
					+ date.getMonth() + "," + date.getDate() + "_"
					+ date.getHours() + "-" + date.getMinutes() + "("
					+ serial++ + ")" + ".xml");
			StreamResult result = new StreamResult(path);
			transformer.transform(source, result);
			return path;
		} catch (ParserConfigurationException e) {
			Main.getFrame().showError("Sorry can't something went wrong with the parser configuration \n"+e.getMessage());
			logger.error("Failed to Parse file");
		}
		catch (TransformerConfigurationException e) {
			Main.getFrame().showError("Sorry can't something went wrong with the transformer configuration \n"+e.getMessage());
			logger.error("faild to set up transformer");
		} catch (TransformerException e) {
			Main.getFrame().showError("Sorry cant transform or create file \n"+e.getMessage());
			logger.error("faild to transform file");
		}
		return null;

	}