XmlFile (@NotNull Module module) { final URL resource = JavaFxSchemaProvider.class.getResource("fx.xsd"); final VirtualFile fileByURL = VfsUtil.findFileByURL(resource); if (fileByURL == null) { LOG.error("xsd not found"); return null; } PsiFile psiFile = PsiManager.getInstance(module.getProject()).findFile(fileByURL); LOG.assertTrue(psiFile != null); return (XmlFile)psiFile.copy(); }