+ " </e1>\n"
+ "</doc>";
Document doc = (new Builder()).build(input, null);
String xpath = "(/*/* | /*/*/namespace::*)\n";
Nodes result = doc.query(xpath);
assertEquals(4, result.size());
Element parent = (Element) result.get(0);
for (int i = 1; i < 4; i++) {
Namespace namespace = (Namespace) result.get(i);
assertEquals(parent, namespace.getParent());