private static String getPrintableElement(Element element) {
        StringBuilder sb = new StringBuilder(element.getTagName());
        final NamedNodeMap attributes = element.getAttributes();
        for (int i = 0; i < attributes.getLength(); i++) {
            sb.append(" ").append(attributes.item(i).getNodeName());
        }
        return sb.toString();
    }
Retains all elements where at least one element is overridden. Removes non-overridden elements from map.
config-application-package/src/main/java/com/yahoo/config/application/OverrideProcessor.java