private static Element getContainerElementInServices(Element element) {
        List<Element> containerElements = new ArrayList<>();
        for (ConfigModelId cid : ContainerModelBuilder.configModelIds) {
            List<Element> children = XML.getChildren(element, cid.getName());
            containerElements.addAll(children);
        }
        
        if (containerElements.size() == 1) {
            return containerElements.get(0);
        } else if (containerElements.isEmpty()) {
            throw new RuntimeException("No container element found under services.");
        } else {
            List<String> nameAndId = containerElements.stream().map(e -> e.getNodeName() + " id='" + e.getAttribute("id") + "'")
                    .toList();
            throw new RuntimeException("Found multiple container elements: " + String.join(", ", nameAndId));
        }
    }
@author Tony Vaagenes
@author gjoranv
@author ollivir
standalone-container/src/main/java/com/yahoo/container/standalone/StandaloneContainerApplication.java