boolean saveXML()
	{
		Document doc = model.getDocument();
		if (doc == null)
			return false;
		fileDlg.setFileFilter(xmlFilter);
		if (fileDlg.showSaveDialog(this) == JFileChooser.APPROVE_OPTION)
		{
			File file = fileDlg.getSelectedFile();
			if (file == null)
				return false;
			if (file.getName().indexOf(".") < 0)
				file = new File(file.getAbsolutePath() + ".xml");
			FileOutputStream out = null;
			Writer writer = null;
			try {
				file.createNewFile();
				out = new FileOutputStream(file);
				OutputFormat format = new OutputFormat(doc, "UTF-8", true);
				writer = new OutputStreamWriter(out, "UTF-8");
				XMLSerializer serial = new XMLSerializer(writer, format);
				serial.asDOMSerializer();
				serial.serialize(doc);
				model.setDocumentChanged(false);
				xmlFileName = file.getName();
				showXMLTitle();
				History childHistory = history.getFirstChild();
				if (childHistory != null)
				{
					childHistory.put(file.getAbsolutePath());
					btnOpenXML.setItems(childHistory.items);
				}
				return true;
			} catch (Exception ex) {
				dblView.showErrorMessage("Error: " + ex.getMessage());
				return false;
			} finally {
				try {
					out.close();
				} catch (Exception ignore) {
				}
				try {
					writer.close();
				} catch (Exception ignore) {
				}
			}
		}
		else
			return false;
	}