private void updateRoot(ArrayList<String> databases) {
		DocumentBuilderFactory docFactory = DocumentBuilderFactory
				.newInstance();
		DocumentBuilder docBuilder;
		try {
			docBuilder = docFactory.newDocumentBuilder();

			// root elements
			Document doc = docBuilder.newDocument();
			Element rootElement = doc.createElement("databases");
			doc.appendChild(rootElement);

			for (String db : databases) {
				Element e = doc.createElement("database");
				e.setTextContent(db);
				rootElement.appendChild(e);
			}

			TransformerFactory transformerFactory = TransformerFactory
					.newInstance();
			Transformer transformer = transformerFactory.newTransformer();
			DOMSource source = new DOMSource(doc);
			StreamResult result = new StreamResult(new File(rootPath
					+ "/root.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");
		}
	}