Element child = new Element("child", "http://www.example.org");
parent.appendChild(child);
child.appendChild("1");
child.appendChild("2");
XPathContext context = new XPathContext("pre", "http://www.example.org");
Nodes result = parent.query("descendant::text()", context);
assertEquals(2, result.size());
assertEquals("1", result.get(0).getValue());
assertEquals("2", result.get(1).getValue());