XmlProcessingInstruction (String qualifiedName, Project project) { final String importText = "<?import " + qualifiedName + "?>"; final PsiElement child = PsiFileFactory.getInstance(project).createFileFromText("a.fxml", XMLLanguage.INSTANCE, importText).getFirstChild(); return PsiTreeUtil.findChildOfType(child, XmlProcessingInstruction.class); }