XML parsing can be done with a simple tag stack and a linear walk through the document. It's very cheap. And a quick loop over 6 (or whatever) strings in L1 cache can easily be faster than a generalized hash table lookup. Given that the namespace tag lookup isn't a huge deal anyway (just walk up the stack doing a string comparison at each level), any optimization needs to be pretty lean to start with. I'd guess that the hash thing is probably a wash; this is the only technique likely to work well.