PsiElement (@Nullable T resolvedValue) { if (resolvedValue instanceof PsiElement) { return (PsiElement)resolvedValue; } if (resolvedValue instanceof DomElement) { return ((DomElement)resolvedValue).getXmlElement(); } return null; }