void (@NotNull final LanguageLevel level) { final MavenDomProjectModel model = MavenDomUtil.getMavenDomProjectModel(project, mavenProject.getFile()); if (model == null) return; WriteCommandAction.writeCommandAction(project, DomUtil.getFile(model)).run(() -> { PsiDocumentManager documentManager = PsiDocumentManager.getInstance(project); XmlFile file = DomUtil.getFile(model); Document document = documentManager.getDocument(file); if (document == null) return; documentManager.commitDocument(document); runLiveTemplate(document, model, level); }); }