NamespaceContext implementation used from http://www.java2s.com/Code/Java/XML/implementsNamespaceContext.htm, tailored just little bit for Java7 in case of diamond marks. This was full of troubles after all, haha.