private Document buildProperties(Document input) {
        NodeList list = input.getElementsByTagNameNS(XmlPreProcessor.preprocessNamespaceUri, "properties");
        while (list.getLength() > 0) {
            Element propertiesElement = (Element) list.item(0);
            Element parent = (Element) propertiesElement.getParentNode();
            for (Node node : XML.getChildren(propertiesElement)) {
                String propertyName = node.getNodeName();
                if (properties.containsKey(propertyName)) {
                    log.log(Level.WARNING, "Duplicate definition for property '" + propertyName + "' detected");
                }
                properties.put(propertyName, node.getTextContent());
            }
            parent.removeChild(propertiesElement);
            list = input.getElementsByTagNameNS(XmlPreProcessor.preprocessNamespaceUri, "properties");
        }
        return input;
    }
Handles getting properties from services.xml and replacing references to properties with their real values

@author hmusum
config-application-package/src/main/java/com/yahoo/config/application/PropertiesProcessor.java