void (VirtualFile profilesFile, String rootElementName, boolean wrapRootIfNecessary, String profilesSource, List<MavenProfile> result, Set<String> alwaysOnProfiles, Collection<MavenProjectProblem> problems) { Element rootElement = readXml(profilesFile, problems, MavenProjectProblem.ProblemType.SETTINGS_OR_PROFILES); if (rootElement == null) return; if (wrapRootIfNecessary && !rootElementName.equals(rootElement.getName())) { Element wrapper = new Element(rootElementName); wrapper.addContent(rootElement); rootElement = wrapper; } List<Element> xmlProfiles = MavenJDOMUtil.findChildrenByPath(rootElement, "profiles", "profile"); collectProfiles(xmlProfiles, result, profilesSource); alwaysOnProfiles.addAll(MavenJDOMUtil.findChildrenValuesByPath(rootElement, "activeProfiles", "activeProfile")); }