It seems a little confusing to modify `oldElement` in here and rely on the side-effects of these changes to cause the right behavior. I think it would be more straightforward to just detect this case in the caller (down below) and just set a local flag there that forces the calls to `generateChildEdits()` (with a null `oldElement`) and the addition of the children to the queue. (We would still need to do the nodemap mutation above, but it would be a little clearer what's happening.) See comment below.