<p>I want to select the topmost element in a document that has a given namespace (prefix).</p>

<p>More specifically: I have XML documents that either start with /html/body (in the XHTML namespace) or with one of several elements in a particular namespace. I effectively want to strip out /html/body and just return the body contents OR the entire root namespaced element. </p>

The XPath expression that I want is:
```
```
/html:html/html:body/node()|/foo:*
```
```
Where the "html" prefix is mapped to the XHTML namespace, and the "foo" prefix is mapped to my target namespace.