XPath and Namespaces

XPath does not have a default namespace. So if you are doing an XPath search against an XML document that has a default namespace, you are not going to find anything, unless you add that namespace to the XPath expression. In the case of a default namespace, this can be confusing. What's the prefix?

Essentially, you have to just make one up, and use it in your query. For example, if the root element is /foo, you need to search for /prefix:foo, where "prefix" is the namespace prefix you invent.

XPath and Default Namespace handling talks about how to do this. I found this document useful, although my JDOM code ended up being a bit simpler than the example given.