@Override
  public void invoke(final @NotNull Project project, final Editor editor, final PsiFile file) throws IncorrectOperationException {
    final XmlTag rootTag = myTargetFile.getDocument().getRootTag();

    Editor targetEditor;
    if (myTargetFile.getVirtualFile() == null) {
      targetEditor = editor;
      targetEditor.getDocument().setText("");
      targetEditor.getCaretModel().moveToOffset(0);
    }
    else {
      targetEditor = FileEditorManager.getInstance(project).openTextEditor(new OpenFileDescriptor(
        project,
        myTargetFile.getVirtualFile(),
        rootTag.getValue().getTextRange().getEndOffset()
      ), true);
    }
    TemplateManager manager = TemplateManager.getInstance(project);
    final Template template = manager.createTemplate("", "");

    addTextTo(template, rootTag);

    manager.startTemplate(targetEditor, template);
  }
@Override
  public void invoke(final @NotNull Project project, final Editor editor, final PsiFile file)