public static @Nullable <T extends DomElement> T findDomElement(final @Nullable PsiElement element, final Class<T> beanClass, boolean strict) {
    if (element == null) return null;

    XmlTag tag = PsiTreeUtil.getParentOfType(element, XmlTag.class, strict);
    DomElement domElement;

    while (tag != null) {
      domElement = DomManager.getDomManager(tag.getProject()).getDomElement(tag);

      if (domElement != null) {
        return domElement.getParentOfType(beanClass, false);
      }
      tag = tag.getParentTag();
    }
    return null;
  }
public static @Nullable <T extends DomElement> T findDomElement(final @Nullable PsiElement element, final Class<T> beanClass, boolean strict)