public void CreateDataBase(String DataBase, ArrayList<Tables> tables) { 
		DocumentBuilderFactory docFactory = DocumentBuilderFactory
				.newInstance();
		DocumentBuilder docBuilder;
		try {
			docBuilder = docFactory.newDocumentBuilder();

			// root elements
			Document doc = docBuilder.newDocument();
			Element rootElement = doc.createElement("database");
			doc.appendChild(rootElement);
			rootElement.setAttribute("name", DataBase);

			if (tables != null)
				for (Tables tb : tables) {
					Element table = doc.createElement("table");

					Element name = doc.createElement("name");
					name.setTextContent(tb.getTableName());
					table.appendChild(name);

					ArrayList<Col> fields = tb.getFields();
					for (Col field : fields) {
						Element e = doc.createElement("field");

						Element nm = doc.createElement("name");
						nm.setTextContent(field.getFieldName());
						e.appendChild(nm);

						Element type = doc.createElement("type");
						type.setTextContent(field.getFieldType());
						e.appendChild(type);

						table.appendChild(e);
					}
					rootElement.appendChild(table);

				}
			TransformerFactory transformerFactory = TransformerFactory
					.newInstance();
			Transformer transformer = transformerFactory.newTransformer();
			DOMSource source = new DOMSource(doc);
			StreamResult result = new StreamResult(new File(rootPath +"/"+DataBase + ".xml"));

			// Output to console for testing
			// StreamResult result = new StreamResult(System.out);

			transformer.transform(source, result);

		} catch (ParserConfigurationException e) {
			JOptionPane.showMessageDialog(null, "DataBase Not Created");
		} catch (TransformerConfigurationException e) {
			JOptionPane.showMessageDialog(null, "DataBase Not Created");
		} catch (Exception e) {
			JOptionPane.showMessageDialog(null, "DataBase Not Created");
		}
	}