function parseGroup(parent, element) {

            var id   = element.getAttribute("id");
            var name = element.getAttribute("name");
            var type_string = element.getAttribute("type");

            // Translate type name
            var type;
            if (type_string === "organizational")
                type = GuacamoleService.ConnectionGroup.Type.ORGANIZATIONAL;
            else if (type_string === "balancing")
                type = GuacamoleService.ConnectionGroup.Type.BALANCING;

            // Create corresponding group
            var group = new GuacamoleService.ConnectionGroup(type, id, name);

            // Set parent
            group.parent = parent;

            // For each child element
            var current = element.firstChild;
            while (current !== null) {

                var i, child;
                var children = current.childNodes;

                if (current.localName === "connections") {

                    // Parse all child connections
                    for (i=0; i<children.length; i++) {
                        var child = children[i];
                        if (child.localName === "connection")
                            group.connections.push(parseConnection(group, child));
                    }
                    
                }
                else if (current.localName === "groups") {

                    // Parse all child groups 
                    for (i=0; i<children.length; i++) {
                        var child = children[i];
                        if (child.localName === "group")
                            group.groups.push(parseGroup(group, child));
                    }
 
                }

                // Next element
                current = current.nextSibling;

            }

            // Sort groups and connections
            group.groups.sort(GuacamoleService.Connections.comparator);
            group.connections.sort(GuacamoleService.Connections.comparator);

            // Return created group
            return group;
            
        }
Recursively parse the contents of the given group element within XML,
returning a corresponding GuacamoleService.ConnectionGroup.

@param {GuacamoleService.ConnectionGroup} The connection group
                                          containing this group.
@param {Element} element The element being parsed.
@return {GuacamoleService.ConnectionGroup} The connection group
                                           represented by the element
                                           just parsed.