PsiFile (String name, PsiFile baseFile) { if (baseFile == null) return null; final VirtualFile virtualFile = VfsUtilCore.findRelativeFile(name, baseFile.getVirtualFile()); if (virtualFile != null) { final PsiFile file = baseFile.getManager().findFile(virtualFile); if (file != baseFile && file instanceof XmlFile) { return file; } } return null; }