Use proper NamespaceContext in XPathNodeCounter
Use Integer.valueOf() instead of new Integer()