When you call getElementsByTagNameNS
you should specify the URI for the namespace, not the prefix used in the xml, so:
getElementsByTagNameNS("gs", CIRCLE);
should be:
getElementsByTagNameNS("http://www.opengis.net/pidflo/1.0", CIRCLE);
because gs:Circle
element is defined under the namespace URI:
xmlns:gs="http://www.opengis.net/pidflo/1.0"
To make namespaces to work, you need to set the factory for it:
DocumentBuilderFactory fact = DocumentBuilderFactory.newInstance();
fact.setNamespaceAware(true);
Or alternatively, you can just use simply (without namespaces) the full qualified name:
getElementsByTagName("gs:Circle");
Note: also note that your xml is invalid in your question because it is missing the closing root element </urn:locationResponse>