In order to avoid hacks like the str_replace one you have there (and I would recommend avoiding that), you can run the XML files through an XSLT to strip out the namespace:
When run on either of these inputs:
The output is the same:
This would allow you to use your prefix-less XPaths on the result.