Index: /trunk/autoquest-core-events/src/main/java/de/ugoe/cs/autoquest/eventcore/guimodel/GUIModel.java
===================================================================
--- /trunk/autoquest-core-events/src/main/java/de/ugoe/cs/autoquest/eventcore/guimodel/GUIModel.java	(revision 1085)
+++ /trunk/autoquest-core-events/src/main/java/de/ugoe/cs/autoquest/eventcore/guimodel/GUIModel.java	(revision 1086)
@@ -21,4 +21,5 @@
 import java.util.LinkedList;
 import java.util.List;
+import java.util.Stack;
 import java.util.logging.Level;
 
@@ -198,4 +199,14 @@
         return roots;
     }
+    
+    /**
+     * returns a traverser for the GUI model to have efficient access to the tree of GUI elements
+     * without having direct access.
+     * 
+     * @return a traverser
+     */
+    public Traverser getTraverser() {
+        return new Traverser();
+    }
 
     /**
@@ -226,6 +237,6 @@
         }
 
-        for (IGUIElement root : getRootElements()) {
-            dumpGUIElement(stream, root, "");
+        for (TreeNode node : root.children) {
+            dumpGUIElement(stream, node, "");
         }
     }
@@ -459,24 +470,23 @@
      * <p>
      * dumps a GUI element to the stream. A dump contains the toString() representation of the GUI
-     * element as well as a indented list of its children surrounded by braces.
+     * element as well as a indented list of its children surrounded by braces. Therefore, not the
+     * GUI element itself but its tree node is provided to have an efficient access to its children
      * </p>
      * 
      * @param out
      *            {@link PrintStream} where the guiElement is dumped to
-     * @param guiElement
-     *            the guiElement whos string represenation is dumped
+     * @param node
+     *            the guiElement's tree node of which the string representation is dumped
      * @param indent
      *            indent string of the dumping
      */
-    private void dumpGUIElement(PrintStream out, IGUIElement guiElement, String indent) {
+    private void dumpGUIElement(PrintStream out, TreeNode node, String indent) {
         out.print(indent);
-        out.print(guiElement);
-
-        List<IGUIElement> children = getChildren(guiElement);
-
-        if ((children != null) && (children.size() > 0)) {
+        out.print(node.guiElement);
+
+        if ((node.children != null) && (node.children.size() > 0)) {
             out.println(" {");
 
-            for (IGUIElement child : children) {
+            for (TreeNode child : node.children) {
                 dumpGUIElement(out, child, indent + "  ");
             }
@@ -523,4 +533,161 @@
     /**
      * <p>
+     * Used externally for tree traversal without providing direct access to the tree nodes
+     * </p>
+     * 
+     * @version 1.0
+     * @author Patrick Harms, Steffen Herbold
+     */
+    public class Traverser {
+        
+        /**
+         * <p>
+         * the stack of nodes on which the traverser currently works
+         * </p>
+         */
+        private Stack<StackEntry> nodeStack = new Stack<StackEntry>();
+        
+        /**
+         * <p>
+         * initializes the traverser by adding the root node of the GUI model to the stack
+         * </p>
+         */
+        private Traverser() {
+            nodeStack.push(new StackEntry(root, 0));
+        }
+        
+        /**
+         * <p>
+         * returns the first child of the current GUI element. On the first call of this method on
+         * the traverser the first of the root GUI elements of the GUI model is returned. If the
+         * current GUI element does not have children, the method returns null. If the GUI model
+         * is empty, then a call to this method will return null. The returned GUI element is the
+         * next one the traverser points to.
+         * </p>
+         *
+         * @return as described.
+         */
+        public IGUIElement firstChild() {
+            return pushChild(0);
+        }
+        
+        /**
+         * <p>
+         * returns true, if the current GUI element has a first child, i.e. if the next call to the
+         * method {@link #firstChild()} would return a GUI element or null.
+         * </p>
+         *
+         * @return as described
+         */
+        public boolean hasFirstChild() {
+            return
+                (nodeStack.peek().treeNode.children != null) &&
+                (nodeStack.peek().treeNode.children.size() > 0);
+        }
+        
+        /**
+         * <p>
+         * returns the next sibling of the current GUI element. If there is no further sibling,
+         * null is returned. If the current GUI element is one of the root nodes, the next root
+         * node of the GUI model is returned. The returned GUI element is the next one the
+         * traverser points to.
+         * </p>
+         *
+         * @return as described
+         */
+        public IGUIElement nextSibling() {
+            int lastIndex = nodeStack.pop().index;
+            
+            IGUIElement retval = pushChild(lastIndex + 1);
+            if (retval == null) {
+                pushChild(lastIndex);
+            }
+            
+            return retval;
+        }
+        
+        /**
+         * <p>
+         * returns true, if the current GUI element has a further sibling, i.e. if a call to the
+         * method {@link #nextSibling()} will return a GUI element;
+         * </p>
+         *
+         * @return as described
+         */
+        public boolean hasNextSibling() {
+            StackEntry entry = nodeStack.pop();
+            boolean result = nodeStack.peek().treeNode.children.size() > (entry.index + 1);
+            pushChild(entry.index);
+            return result;
+        }
+        
+        /**
+         * <p>
+         * returns the parent GUI element of the current GUI element. If the current GUI element
+         * is a root node, null is returned. If there is no current GUI element yet as the method
+         * {@link #firstChild()} was not called yet, null is returned.
+         * </p>
+         *
+         * @return as described
+         */
+        public IGUIElement parent() {
+            IGUIElement retval = null;
+            
+            if (nodeStack.size() > 1) {
+                nodeStack.pop();
+                retval = nodeStack.peek().treeNode.guiElement;
+            }
+            
+            return retval;
+        }
+        
+        /**
+         * <p>
+         * internal method used for changing the state of the traverser. I.e. to switch to a
+         * specific child GUI element of the current one.
+         * </p>
+         */
+        private IGUIElement pushChild(int index) {
+            IGUIElement retVal = null;
+            
+            if ((nodeStack.peek().treeNode.children != null) &&
+                (nodeStack.peek().treeNode.children.size() > index))
+            {
+                nodeStack.push
+                    (new StackEntry(nodeStack.peek().treeNode.children.get(index), index));
+                retVal = nodeStack.peek().treeNode.guiElement;
+            }
+            
+            return retVal;
+        }
+        
+        /**
+         * <p>
+         * internal class needed to fill the stack with nodes of the GUI models and their
+         * respective index in the children of the parent node.
+         * </p>
+         */
+        private class StackEntry {
+            
+            /** */
+            private TreeNode treeNode;
+            
+            /** */
+            private int index;
+            
+            /**
+             * <p>
+             * creates a new stack entry.
+             * </p>
+             */
+            private StackEntry(TreeNode treeNode, int index) {
+                this.treeNode = treeNode;
+                this.index = index;
+            }
+        }
+    }
+
+    /**
+     * <p>
      * Used internally for building up the tree of GUI elements.
      * </p>
Index: /trunk/autoquest-ui-swt/src/main/java/de/ugoe/cs/autoquest/ui/swt/ShowGuiModelDialog.java
===================================================================
--- /trunk/autoquest-ui-swt/src/main/java/de/ugoe/cs/autoquest/ui/swt/ShowGuiModelDialog.java	(revision 1085)
+++ /trunk/autoquest-ui-swt/src/main/java/de/ugoe/cs/autoquest/ui/swt/ShowGuiModelDialog.java	(revision 1086)
@@ -119,9 +119,30 @@
 
     private void buildGuiTree() {
-        for (IGUIElement element : model.getRootElements()) {
+        GUIModel.Traverser traverser = model.getTraverser();
+        
+        IGUIElement root = traverser.firstChild();
+        
+        while (root != null) {
             TreeItem child = new TreeItem(guiTree, SWT.NULL);
-            child.setText(element.toString());
-            child.setData(element);
-            buildGuiTree(child, model.getChildren(element));
+            child.setText(root.toString());
+            child.setData(root);
+            buildGuiTree(child, traverser);
+            root = traverser.nextSibling();
+        }
+    }
+
+    private void buildGuiTree(TreeItem currentParent, GUIModel.Traverser traverser) {
+        if (traverser.hasFirstChild()) {
+            IGUIElement childElement = traverser.firstChild();
+        
+            while (childElement != null) {
+                TreeItem child = new TreeItem(currentParent, SWT.NULL);
+                child.setText(childElement.toString());
+                child.setData(childElement);
+                buildGuiTree(child, traverser);
+                childElement = traverser.nextSibling();
+            }
+        
+            traverser.parent();
         }
     }
