private void parseElement(Element currElem, ConfigPayloadBuilder payloadBuilder, String parentName) {
        List<Element> children = XML.getChildren(currElem);
        try {
            if (children.isEmpty()) {
                parseLeaf(currElem, payloadBuilder, parentName);
            } else {
                parseComplex(currElem, children, payloadBuilder, parentName);
            }
        } catch (Exception exception) {
            throw new IllegalArgumentException("Error parsing element at " + XML.getNodePath(currElem, " > ") +
                                               ": " + Exceptions.toMessageString(exception));
        }
    }
Adds the values and children (recursively) in the given xml element to the given {@link ConfigPayloadBuilder}.
@param currElem  The element representing a config parameter.
@param payloadBuilder The builder to use when adding elements.
config-model/src/main/java/com/yahoo/vespa/model/builder/xml/dom/DomConfigPayloadBuilder.java