PsiElement () { VirtualFile baseDir = myPsiFile.getVirtualFile().getParent(); if (baseDir == null) return null; String path = FileUtil.toSystemIndependentName(myText); VirtualFile file = baseDir.findFileByRelativePath(path); if (file == null || file.isDirectory()) { String relPath = FileUtil.toSystemIndependentName(path + "/" + MavenConstants.POM_XML); file = baseDir.findFileByRelativePath(relPath); } if (file == null) return null; return getPsiFile(file); }