Just came across something which is possibly a bug but don't have time to think about right now ...
Special characters in url path segments are not encoded, i.e. url.here. child('?') generates a broken URL. Perhaps the encoding is dependent on where the URL is used, i.e. in an attribute vs in the page content. That's the bit that I haven't thought about yet.
Anyway, this is just to prompt me or someone else to look into it properly.