private void writeServicesXml() throws IOException {
        String servicesXml = readTemplate("services.xml");
        
        // replace document_type in services.xml with the actual document type
        servicesXml = servicesXml.replace("document_type", config.getDocumentType());

        // If mTLS is enabled, uncomment the mTLS configuration
        if (config.isGenerateMtlsCertificates()) {
            servicesXml = servicesXml
                .replace("<!-- MTLS", "")  // remove opening comment
                .replace("END MTLS -->", "");  // remove closing comment
        }

        try {
            Path filePath = Paths.get(config.getApplicationPackageDir(), "services.xml");
            Files.write(filePath, servicesXml.getBytes(StandardCharsets.UTF_8));
        } catch (IOException e) {
            logger.error("Error writing services.xml: {}", e.getMessage());
            throw e;
        }
    }
Writes the services.xml file by replacing template placeholders with actual values.

@throws IOException if an error occurs while writing the services.xml file
integration/logstash-plugins/logstash-output-vespa/src/main/java/org/logstashplugins/VespaAppPackageWriter.java