Document guidelines for getElementsByTagNameNS and optimize all usages

Adds documentation as requested. Fixed #736.
This one is faster here as the ``clear(containerList[i])`` call below will modify DOM content.