The replace action works by replacing the children of the selected element.
This new feature would be an action that replaces the entire selected element.
It's going to take a different implementation strategy, because the current approach just selects the element (using the selector string) and then modifies its children.
To replace the whole selected element, we need to have access to the parent element and modify the parent's children.
It should continue to support replacing the element with an array of nodes or with no node at all (in which case the element is just removed without a trace).