private Set<InstanceName> getInstances(Element element) {
        String instance = element.getAttributeNS(XmlPreProcessor.deployNamespaceUri, INSTANCE_ATTRIBUTE);
        if (instance.isEmpty()) return Set.of();
        return Arrays.stream(instance.split(" ")).map(InstanceName::from).collect(Collectors.toSet());
    }
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