static String effectiveServices(File servicesFile, ZoneId zone, CloudName cloud, InstanceName instance, Tags tags) throws Exception {
        Document processedServicesXml = new XmlPreProcessor(servicesFile.getParentFile(),
                                                            servicesFile,
                                                            instance,
                                                            zone.environment(),
                                                            zone.region(),
                                                            cloud,
                                                            tags)
                .run();
        Transformer transformer = TransformerFactory.newInstance().newTransformer();
        transformer.setOutputProperty(OutputKeys.INDENT, "yes");
        Writer writer = new StringWriter();
        transformer.transform(new DOMSource(processedServicesXml), new StreamResult(writer));
        return writer.toString().replaceAll("\n(\\s*\n)+","\n");
    }
Computes the effective services.xml for the indicated zone.

@author jonmv
@author olaa
vespa-maven-plugin/src/main/java/ai/vespa/hosted/plugin/EffectiveServicesMojo.java