private static @NotNull Set<String> getNsLocations(final @NotNull XmlTag tag, @Nullable String ns) {
    if (XmlUtil.XHTML_URI.equals(ns)) {
      return Collections.singleton(XmlUtil.getDefaultXhtmlNamespace(tag.getProject()));
    }
    Set<String> locations = new HashSet<>();
    if (XmlNSDescriptorImpl.equalsToSchemaName(tag, XmlNSDescriptorImpl.SCHEMA_TAG_NAME) && ns != null) {
      for (XmlTag subTag : tag.getSubTags()) {
        if (XmlNSDescriptorImpl.equalsToSchemaName(subTag, XmlNSDescriptorImpl.IMPORT_TAG_NAME) &&
            ns.equals(subTag.getAttributeValue("namespace"))) {
          String location = subTag.getAttributeValue("schemaLocation");
          ContainerUtil.addIfNotNull(locations, location);
        }
      }
    }
    if (locations.isEmpty()) {
      locations.add(XmlUtil.getSchemaLocation(tag, ns));
    }

    return locations;
  }
private static @NotNull Set<String> getNsLocations(final @NotNull XmlTag tag, @Nullable String ns)