code: function aaRecreateElementFromEntry(p, elementEntry) {
      const ns = p.treeAdapter.getNamespaceURI(elementEntry.element);
      const newElement = p.treeAdapter.createElement(elementEntry.token.tagName, ns, elementEntry.token.attrs);
  
      p.openElements.replace(elementEntry.element, newElement);
      elementEntry.element = newElement;
  
      return newElement;
  }
docs: Step 13.7 of the algorithm