AntDomElement (PsiElement element) { if (element instanceof PomTargetPsiElement) { final PomTarget target = ((PomTargetPsiElement)element).getTarget(); if (target instanceof DomTarget) { final DomElement domElement = ((DomTarget)target).getDomElement(); if (domElement instanceof AntDomElement) { return (AntDomElement)domElement; } } } return null; }