Fixed exception when parsing XML with comments.

Fixed exception when parsing XML with comments
Would be good to add a comment about why we are doing this check here, for later reference. 

Also, rather than returning silently when the tag isn't a string, I'd rather explicitly check for the case that has been identified (XML comment) - this way if the tag isn't a string for another reason, we would see it - otherwise that could silence too many cases, and make maintenance more difficult.