private static RouteSpec createRouteSpec(Element element) {
        boolean verify = shouldVerify(element);
        RouteSpec route = new RouteSpec(element.getAttribute("name"), verify);
        String hops = element.getAttribute("hops");
        int from = 0;
        for (int to = 0, depth = 0, len = hops.length(); to < len; ++to) {
            if (hops.charAt(to) == '[') {
                ++depth;
            } else if (hops.charAt(to) == ']') {
                --depth;
            } else if (hops.charAt(to) == ' ' && depth == 0) {
                if (to > from) {
                    route.addHop(hops.substring(from, to));
                }
                from = to + 1;
            }
        }
        if (from < hops.length()) {
            route.addHop(hops.substring(from));
        }
        return route;
    }
This function creates a route from the content of the given xml element.

@param element The element to base the route config on.
@return The corresponding route spec.
config-model/src/main/java/com/yahoo/vespa/model/builder/xml/dom/DomRoutingBuilder.java