@Override
  public @Nullable @Nls String generateDoc(PsiElement psiElement, PsiElement psiElement1) {
    if (psiElement instanceof DocElement element) {
      return getDocumentation(element.getName(), element.getCategory());
    }

    if (psiElement instanceof XsltElement) {
      final XmlTag t = ((XsltElement)psiElement).getTag();
      PsiElement p = t.getPrevSibling();
      while (p instanceof PsiWhiteSpace || p instanceof XmlText) {
        p = p.getPrevSibling();
      }
      if (p instanceof XmlComment) {
        final String commentText = ((XmlComment)p).getCommentText();
        return commentText.replaceAll("&", "&amp;").replaceAll("<", "&lt;");
      }
      else {
        return null;
      }
    }

    final String name = getTagName(psiElement);
    if (name != null) {
      return getDocumentation(name, "element");
    }
    else if (psiElement instanceof XPathFunction) {
      return getDocumentation(((XPathFunction)psiElement).getName(), "function");
    }

    return null;
  }
@Override
  public @Nullable @Nls String generateDoc(PsiElement psiElement, PsiElement psiElement1)