ExtensionPoint (PsiElement declaration) { DomElement domElement = null; if (declaration instanceof PomTargetPsiElement) { final PomTarget pomTarget = ((PomTargetPsiElement)declaration).getTarget(); if (pomTarget instanceof DomTarget) { domElement = ((DomTarget)pomTarget).getDomElement(); } } // via XmlTag for "qualifiedName" else if (declaration instanceof XmlTag) { domElement = DomUtil.getDomElement(declaration); } return ObjectUtils.tryCast(domElement, ExtensionPoint.class); }