private static @Nullable XmlDocument findSuitableXmlDocument(@Nullable PsiFile psiFile) {
    if (psiFile instanceof XmlFile) {
      final XmlDocument document = ((XmlFile)psiFile).getDocument();
      if (document != null && document.getRootTag() != null) {
        return document;
      }
    }
    return null;
  }
private static @Nullable XmlDocument findSuitableXmlDocument(@Nullable PsiFile psiFile)