@Override
  public void invoke(final @NotNull Project project, Editor editor, @NotNull PsiElement element) throws IncorrectOperationException {
    final XmlAttribute xmlns = getXmlnsDeclaration(element);
    if (xmlns == null) return;
    SchemaPrefixReference prefixRef = null;
    for (PsiReference ref : xmlns.getReferences()) {
      if (ref instanceof SchemaPrefixReference) {
        prefixRef = (SchemaPrefixReference)ref;
        break;
      }
    }
    if (prefixRef == null) return;

    final SchemaPrefix prefix = prefixRef.resolve();
    final String ns = prefixRef.getNamespacePrefix();
    final ArrayList<XmlTag> tags = new ArrayList<>();
    final ArrayList<XmlAttribute> attrs = new ArrayList<>();
    xmlns.getParent().accept(new XmlRecursiveElementVisitor() {
      @Override
      public void visitXmlTag(@NotNull XmlTag tag) {
        if (ns.equals(tag.getNamespacePrefix())) {
          tags.add(tag);
        }
        super.visitXmlTag(tag);
      }

      @Override
      public void visitXmlAttributeValue(@NotNull XmlAttributeValue value) {
        if (value.getValue().startsWith(ns + ":")) {
          for (PsiReference ref : value.getReferences()) {
            if (ref instanceof SchemaPrefixReference && ref.isReferenceTo(prefix)) {
              attrs.add((XmlAttribute)value.getParent());
            }
          }
        }
      }
    });

    if (!FileModificationService.getInstance().preparePsiElementsForWrite(xmlns.getContainingFile())) return;

    CommandProcessor.getInstance().executeCommand(project, () -> {
      convertTagsAndAttributes(ns, tags, attrs, project);
      ApplicationManager.getApplication().runWriteAction(() -> {
        xmlns.setName("xmlns");
      });
    }, XmlBundle.message("xml.intention.reset.to.default.namespace.command"), null);

    WriteCommandAction.writeCommandAction(project, xmlns.getContainingFile()).withName(
      XmlBundle.message("xml.intention.reset.to.default.namespace.command")).run(() -> xmlns.setName("xmlns"));
  }
@Override
  public void invoke(final @NotNull Project project, Editor editor, @NotNull PsiElement element)