Index: /trunk/autoquest-htmlmonitor-test/src/test/java/de/ugoe/cs/autoquest/htmlmonitor/HtmlMonitorTest.java
===================================================================
--- /trunk/autoquest-htmlmonitor-test/src/test/java/de/ugoe/cs/autoquest/htmlmonitor/HtmlMonitorTest.java	(revision 1428)
+++ /trunk/autoquest-htmlmonitor-test/src/test/java/de/ugoe/cs/autoquest/htmlmonitor/HtmlMonitorTest.java	(revision 1429)
@@ -423,7 +423,6 @@
         assertNotNull(nodes);
         
-        // wait for only 9 nodes. The directly used GUI elements are 10, but one (the body) is the
-        // parent of the others. input9 is unused and must, therefore, not be logged.
-        assertEquals(9, nodes.size());
+        // wait for all 10 GUI elements on the same page to be logged although only 9 are used
+        assertEquals(10, nodes.size());
         
         // get input nodes
@@ -433,5 +432,11 @@
             assertTrue(node instanceof HTMLPageElement);
             assertEquals("HTML", node.getPlatform());
-            assertTrue(node.isUsed());
+            
+            if (!"input9".equals(((HTMLPageElement) node).getHtmlId())) {
+                assertTrue(node.isUsed());
+            }
+            else {
+                assertFalse(node.isUsed());
+            }
 
             assertNotNull(guiModel.getChildren(node));
@@ -462,5 +467,5 @@
         assertEvent(sequence.get(7), 8, MouseClick.class, nodes.get(7), 255, 4);
         assertEvent(sequence.get(8), 9, Scroll.class, body, 0, 0);
-        assertEvent(sequence.get(9), 10, MouseClick.class, nodes.get(8), 516, 154);
+        assertEvent(sequence.get(9), 10, MouseClick.class, nodes.get(9), 516, 154);
 
     }
Index: /trunk/autoquest-htmlmonitor/src/main/java/de/ugoe/cs/autoquest/htmlmonitor/HtmlMonitorOutputWriter.java
===================================================================
--- /trunk/autoquest-htmlmonitor/src/main/java/de/ugoe/cs/autoquest/htmlmonitor/HtmlMonitorOutputWriter.java	(revision 1428)
+++ /trunk/autoquest-htmlmonitor/src/main/java/de/ugoe/cs/autoquest/htmlmonitor/HtmlMonitorOutputWriter.java	(revision 1429)
@@ -265,6 +265,6 @@
     /**
      * <p>
-     * dumps a GUI element starting with its parent GUI elements into the log file. Calls itself
-     * recursively to traverse for dumping the parents first.
+     * ensures that a GUI element, its parents as well as all other GUI elements on the same page
+     * are dumped
      * </p>
      *
@@ -274,12 +274,59 @@
         if (!loggedGUIElements.contains(guiElement)) {
             
-            HtmlGUIElement parent = guiElement.getParent();
-            String parentId = null;
-            
-            if (parent != null) {
-                ensureGuiElementDumped(parent);
-                parentId = parent.getId();
-            }
-            
+            // determine the document as the whole document needs to be dumped. Ensure also that
+            // the server is dumped
+            
+            HtmlGUIElement parent = guiElement;
+            HtmlDocument document = null;
+            HtmlServer server = null;
+            
+            while (parent != null) {
+                if (parent instanceof HtmlDocument) {
+                    document = (HtmlDocument) parent;
+                }
+                else if (parent instanceof HtmlServer) {
+                    server = (HtmlServer) parent;
+                }
+                
+                parent = parent.getParent();
+            }
+            
+            if (server != null) {
+                dumpGuiElement(server);
+            }
+            
+            if (document != null) {
+                dumpGuiStructure(document);
+            }
+        }
+    }
+
+    /**
+     * <p>
+     * dumps the GUI structure provided by the parameter into the log file. Calls itself
+     * recursively to traverse the GUI structure.
+     * </p>
+     *
+     * @param guiStructure the GUI structure to be logged
+     */
+    private void dumpGuiStructure(HtmlGUIElement guiStructure) {
+        dumpGuiElement(guiStructure);
+        
+        if (guiStructure.getChildren() != null) {
+            for (HtmlGUIElement child : guiStructure.getChildren()) {
+                dumpGuiStructure(child);
+            }
+        }
+    }
+
+    /**
+     * <p>
+     * dumps the GUI element provided by the parameter into the log file.
+     * </p>
+     *
+     * @param guiElement the GUI element to be logged
+     */
+    private void dumpGuiElement(HtmlGUIElement guiElement) {
+        if (!loggedGUIElements.contains(guiElement)) {
             outputWriter.print("<component id=\"");
             outputWriter.print(guiElement.getId());
@@ -301,5 +348,7 @@
             }
             
-            dumpParam("parent", parentId);
+            if (guiElement.getParent() != null) {
+                dumpParam("parent", guiElement.getParent().getId());
+            }
         
             outputWriter.println("</component>");
