private void parseLeaf(Element element, ConfigPayloadBuilder payloadBuilder, String parentName) {
        String name = extractName(element);
        String value = XML.getValue(element);
        if (value == null) {
            throw new IllegalArgumentException("Element '" + name + "' must have either children or a value");
        }

        if ("item".equals(name)) {
            if (parentName == null)
                throw new IllegalArgumentException("<item> is a reserved keyword for array and map elements");
            if (element.hasAttribute("key")) {
                payloadBuilder.getMap(parentName).put(element.getAttribute("key"), value);
            } else {
                payloadBuilder.getArray(parentName).append(value);
            }
        }
        else if (element.hasAttribute("model-id") || element.hasAttribute("url") || element.hasAttribute("path")) {
            // special syntax for "model" fields
            var model = ModelReference.unresolved(modelElement("model-id", element),
                                                  modelElement("url", element).map(UrlReference::new),
                                                  modelElement("path", element).map(FileReference::new));
            payloadBuilder.setField(name, model.toString());
        }
        else { // leaf value: <myValueName>value</myValue>
            payloadBuilder.setField(name, value);
        }
    }
Parse leaf value in an xml tree.
config-model/src/main/java/com/yahoo/vespa/model/builder/xml/dom/DomConfigPayloadBuilder.java