public static void generateTag(@NotNull XmlTag newTag, Editor editor) {
    generateRaw(newTag);
    final XmlTag restored = CodeInsightUtilCore.forcePsiPostprocessAndRestoreElement(newTag);
    if (restored == null) {
      LOG.error("Could not restore tag: " + newTag.getText());
    }
    TemplateBuilder builder = TemplateBuilderFactory.getInstance().createTemplateBuilder(restored);
    replaceElements(restored, builder);
    builder.run(editor, false);
  }
public static void generateTag(@NotNull XmlTag newTag, Editor editor)