things play nicely with text elements in the trees

Fixes tokuhirom/Web-Query#24
Merge pull request #29 from yanick/replace_with

things play nicely with text elements in the trees