private static @Nullable String getTopLevelNodeLocation(GenericDomValue<?> element) {
    if (element instanceof Dependency dependency) {
      @NonNls String result = dependency.getRawText();

      Boolean optional = dependency.getOptional().getValue();
      if (optional != null && optional) {
        result += " [optional]";
      }
      return result;
    }

    if (KNOWN_TOP_LEVEL_NODE_NAMES.contains(StringUtil.toLowerCase(element.getXmlElementName()))) {
      return element.getRawText();
    }

    return null;
  }
private static @Nullable String getTopLevelNodeLocation(GenericDomValue<?> element)