public List<Element> createQueryProfiles(List<NamedReader> queryProfileReaders, QueryProfileRegistry registry) {
        List<Element> queryProfileElements = new ArrayList<>(queryProfileReaders.size());
        for (NamedReader reader : queryProfileReaders) {
            Element root = XML.getDocument(reader).getDocumentElement();
            if ( ! root.getNodeName().equals("query-profile")) {
                throw new IllegalArgumentException("Root tag in '" + reader.getName() +
                                                   "' must be 'query-profile', not '" + root.getNodeName() + "'");
            }

            String idString = root.getAttribute("id");
            if (idString.isEmpty())
                throw new IllegalArgumentException("Query profile '" + reader.getName() +
                                                   "' has no 'id' attribute in the root element");
            ComponentId id = new ComponentId(idString);
            validateFileNameToId(reader.getName(), id, "query profile");

            QueryProfile queryProfile = new QueryProfile(id, reader.getName(), registry);
            String typeId = root.getAttribute("type");
            if (! typeId.isEmpty()) {
                QueryProfileType type = registry.getType(typeId);
                if (type == null)
                    throw new IllegalArgumentException("Query profile '" + reader.getName() +
                                                       "': Type id '" + typeId + "' can not be resolved");
                queryProfile.setType(type);
            }

            Element dimensions = XML.getChild(root, "dimensions");
            if (dimensions != null)
                queryProfile.setDimensions(toArray(XML.getValue(dimensions)));

            registry.register(queryProfile);
            queryProfileElements.add(root);
        }
        return queryProfileElements;
    }
Read the XML file readers into a registry. This does not close the readers.
This method is used directly from the admin system.
container-search/src/main/java/com/yahoo/search/query/profile/config/QueryProfileXMLReader.java