PsiElement (final Element element) { if (element.getAttributeValue(ATTRIBUTE_URL) != null) { final String url = element.getAttributeValue(ATTRIBUTE_URL); final VirtualFile file = VirtualFileManager.getInstance().findFileByUrl(url); return file != null ? PsiManager.getInstance(project).findDirectory(file) : null; } if (element.getAttributeValue(ATTRIBUTE_CLASS) != null) { final String className = element.getAttributeValue(ATTRIBUTE_CLASS); return className != null ? JavaPsiFacade.getInstance(project).findClass(className, GlobalSearchScope.allScope(project)) : null; } return null; }