fixes recursion in getElement{ById,sByTagName}

Fixes getElementById and getElementsByTagName to work no matter how deep the
target element(s) might be in the XML tree.
Merge pull request #1 from thecabinet/master

fixes recursion in getElement{ById,sByTagName}