However what it doesn’t show you is how to access those same elements and attributes when the XML object contains one or more namespace declarations.
Consider the following XML sample:
Because of the namespace declaration, you can’t simply access the statusCode element with
response.statusCode, despite the fact that the statusCode element resides in the default namespace.
What you need to do is iterate over the set of XML namespaces until you locate the default namespace. Then you can access any of the XML elements or attributes in the default namespace in nearly the same manner as before.
In the above example,
xmlns would be a
Namespace object that references the default XML namespace.
Check out the tasty sample code here.