private static boolean isText(PsiElement element) {
    if (element instanceof XmlText) return true;
    if (element instanceof XmlEntityRef && element.getParent() instanceof XmlText) return true;
    return false;
  }
private static boolean isText(PsiElement element)