void writeDesktopNode(PrintWriter out) throws IOException {

		Window desktopWindow = SwingUtilities.getWindowAncestor(this);
		Point windowLocation;
		if (desktopWindow != null) {
			windowLocation = desktopWindow.getLocation();
		} else {
			windowLocation = new Point(); // fail safe
		}

		out.println("<DockingDesktop name=\"" + desktopName + "\">");
		out.println("<DockingPanel x=\"" + (int) windowLocation.getX()
				+ "\" y=\"" + (int) windowLocation.getY() + "\" width=\""
				+ desktopWindow.getWidth() + "\" height=\""
				+ desktopWindow.getHeight() + "\"" + ">");
		if (dockingPanel.getComponentCount() > 0) {
			// only one top component (DockableContainer or SplitContainer)
			xmlWriteComponent(dockingPanel.getComponent(0), out);
		}

		Dockable max = getMaximizedDockable(); // 2007/01/08
		if (max != null) {
			out.println("<MaximizedDockable>");
			DockKey key = max.getDockKey();
			out.println("<Key dockName=\"" + key.getKey() + "\"/>");
			out.println("</MaximizedDockable>");
		}

		out.println("</DockingPanel>");

		for (int i = 0; i < borderPanes.length; i++) {
			xmlWriteBorder(borderPanes[i], out);
		}

		// finish with the floating dockables
		xmlWriteFloating(out);

		// and the tab groups
		xmlWriteTabGroups(out);

		out.println("</DockingDesktop>");
	}