private String stripXmlEnding(String fileName) {
        if (!fileName.endsWith(".xml"))
            throw new IllegalArgumentException("'" + fileName + "' should have a .xml ending");
        else
            return fileName.substring(0, fileName.length() - 4);
    }
Throws an exception if the name is not corresponding to the id
container-search/src/main/java/com/yahoo/search/pagetemplates/config/PageTemplateXMLReader.java