function parseConnection(parent, element) {

            var i;

            var connection = new GuacamoleService.Connection(
                element.getAttribute("protocol"),
                element.getAttribute("id"),
                element.getAttribute("name")
            );

            // Set parent
            connection.parent = parent;

            // Add parameter values for each parmeter received
            var paramElements = element.getElementsByTagName("param");
            for (i=0; i<paramElements.length; i++) {

                var paramElement = paramElements[i];
                var name = paramElement.getAttribute("name");

                connection.parameters[name] = paramElement.textContent;

            }

            // Parse history, if available
            var historyElements = element.getElementsByTagName("history");
            if (historyElements.length === 1) {

                // For each record in history
                var history = historyElements[0];
                var recordElements = history.getElementsByTagName("record");
                for (i=0; i<recordElements.length; i++) {

                    // Get record
                    var recordElement = recordElements[i];
                    var record = new GuacamoleService.Connection.Record(
                        recordElement.textContent,
                        parseInt(recordElement.getAttribute("start")),
                        parseInt(recordElement.getAttribute("end")),
                        recordElement.getAttribute("active") === "yes"
                    );

                    // Append to connection history
                    connection.history.push(record);

                }

            }

            // Return parsed connection
            return connection;

        }
Parse the contents of the given connection element within XML,
returning a corresponding GuacamoleService.Connection.

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