Change behavior of empty root node replace

Now hquery leaves an ugly comment and there's a testcase for it. However, this
is needed for the star transformer to work when replacing an empty node, so
it's not all bad. I should really fix this at some point.