public @NotNull List<@NotNull XmlFile> getCharEntitiesDTDs(@NotNull XmlFile file) {
    XmlDocument document = file.getDocument();
    if (HtmlUtil.isHtml5Document(document)) {
      return ContainerUtil.packNullables(XmlUtil.findXmlFile(file, Html5SchemaProvider.getCharsDtdLocation()));
    }
    else if (document != null) {
      final XmlTag rootTag = document.getRootTag();
      if (rootTag != null) {
        final XmlElementDescriptor descriptor = rootTag.getDescriptor();

        if (descriptor != null && !(descriptor instanceof AnyXmlElementDescriptor)) {
          PsiElement element = descriptor.getDeclaration();
          final PsiFile containingFile = element != null ? element.getContainingFile() : null;
          if (containingFile instanceof XmlFile) {
            return Collections.singletonList((XmlFile)containingFile);
          }
        }
      }
      final FileType ft = file.getFileType();
      final String namespace = ft == XHtmlFileType.INSTANCE || ft == StdFileTypes.JSPX ? XmlUtil.XHTML_URI : XmlUtil.HTML_URI;
      final XmlNSDescriptor nsDescriptor = document.getDefaultNSDescriptor(namespace, true);
      if (nsDescriptor != null) {
        return ContainerUtil.packNullables(nsDescriptor.getDescriptorFile());
      }
    }
    return Collections.emptyList();
  }
public @NotNull List<@NotNull XmlFile> getCharEntitiesDTDs(@NotNull XmlFile file)