private void xmlBuildFloatingNode(NodeList dockables, Rectangle bounds)
			throws SAXException {

		// @todo not optimal.. we should refactor it oustide this method
		Window desktopWindow = SwingUtilities.getWindowAncestor(this);
		if (desktopWindow != null) {
			Point windowLocation = desktopWindow.getLocation();
			bounds.x += windowLocation.x; // position is relative
			bounds.y += windowLocation.y;
		}

		// JDialog dialog = null;
		FloatingDockableContainer fdc = null;
		TabbedDockableContainer tdc = null;
		if (dockables.getLength() > 1) { // it's a floating tab
			tdc = DockableContainerFactory.getFactory()
					.createTabbedDockableContainer();
			tdc.installDocking(this);
			((JTabbedPane) tdc).addChangeListener(focusHandler); // our best way
																	// to track
																	// selection
																	// (focus)
																	// changes
		}

		Dockable baseDockable = null; // used when there are tabs

		for (int i = 0; i < dockables.getLength(); i++) {
			Element dockableElt = (Element) dockables.item(i);
			Element hideElt = (Element) dockableElt.getElementsByTagName(
					"RelativePosition").item(0);
			float x = Float.parseFloat(hideElt.getAttribute("x"));
			float y = Float.parseFloat(hideElt.getAttribute("y"));
			float w = Float.parseFloat(hideElt.getAttribute("w"));
			float h = Float.parseFloat(hideElt.getAttribute("h"));
			RelativeDockablePosition position = new RelativeDockablePosition(
					dockingPanel, x, y, w, h);

			Dockable dockable = xmlGetDockable(dockableElt);
			if (i == 0) {
				baseDockable = dockable;
			}

			Element previousState = (Element) dockableElt.getElementsByTagName(
					"PreviousState").item(0);
			int istate = Integer.parseInt(previousState.getAttribute("state"));
			DockableState state = new DockableState(this, dockable,
					DockableState.getLocationFromInt(istate), position);
			storePreviousFloatingState(dockable, state);

			if (fdc == null) {
				// if (dialog == null}){
				// dialog = (JDialog) createFloatingDockableContainer(dockable);
				fdc = createFloatingDockableContainer(dockable);
			} else {
				// add as a tab
				if (tdc.getTabCount() == 0) {
					// first tab : replace the current DetachedDockView by the
					// tab container
					// not very efficient... @todo : sort this out
					DockableContainer base = DockingUtilities
							.findDockableContainer(baseDockable);
					DockingUtilities.replaceChild(
							((Component) base).getParent(), (Component) base,
							(Component) tdc);
					tdc.addDockable(baseDockable, 0);
				}
				tdc.addDockable(dockable, tdc.getTabCount());
			}

			context.setDockableState(dockable, new DockableState(this,
					dockable, DockableState.Location.FLOATING, position));
			dockable.getDockKey().setLocation(DockableState.Location.FLOATING);

			if (dockable instanceof CompoundDockable) {
				// check for children and build them
				xmlBuildCompoundDockable((CompoundDockable) dockable,
						dockableElt, DockableState.Location.FLOATING);
			}
		}

		DockingUtilities.setBounds(fdc, bounds);
		// dialog.setBounds(bounds);
		// dialog.validate();
		// dialog.setVisible(true);
		DockingUtilities.validate(fdc);
		DockingUtilities.setVisible(fdc, true);

	}