private void readVariants(Element element, QueryProfile profile, QueryProfileRegistry registry) {
        for (Element queryProfileVariantElement : XML.getChildren(element,"query-profile")) { // A "virtual" query profile contained inside another
            List<String> dimensions = profile.getDimensions();
            if (dimensions == null)
                throw new IllegalArgumentException("Cannot create a query profile variant in " + profile +
                                                   ", as it has not declared any variable dimensions");
            String dimensionString = queryProfileVariantElement.getAttribute("for");
            String[] dimensionValueArray = makeStarsNull(toArray(dimensionString));
            if (dimensions.size()<dimensionValueArray.length)
                throw new IllegalArgumentException("Cannot create a query profile variant for '" + dimensionString +
                                                   "' as only " + dimensions.size() + " dimensions has been defined");
            DimensionValues dimensionValues = DimensionValues.createFrom(dimensionValueArray);

            String description = "variant '" + dimensionString + "' in " + profile.toString();
            readInherited(queryProfileVariantElement, profile, registry, dimensionValues, description);
            readFields(queryProfileVariantElement, profile, registry, dimensionValues, description);
        }
    }
Throws an exception if the name is not corresponding to the id
container-search/src/main/java/com/yahoo/search/query/profile/config/QueryProfileXMLReader.java