The xml-rpc driver merges text node results. public void testGetMultipleTextNodes() throws Exception { String query = "//person/first/text()"; Collection col = this.client.getCollection(TEST_COLLECTION_PATH); XPathQueryService xpathservice = (XPathQueryService) col.getService("XPathQueryService", "1.0"); ResourceSet resultSet = xpathservice.query(query); ResourceIterator results = resultSet.getIterator(); List res = asList(results); assertEquals(2, res.size()); } Internally two TextImpl nodes are returned to the server. The server puts these into a result document and sends it back. As it returns it is serialises the Result document to a text stream. This has the effect of flattening the two text nodes into one and thus breaking the test (this doesn't happen with the embeded driver).
Fixed. Each text node result is wrapped into the <query:result> element, which has meta information and result text node.