// XXX this is expensive for very large documents. In those cases another
// XXX method (direct processing of SAX events, or XMLPull) should be used.
XPath path = new JDOMXPath("//text:span | //text:p | //text:tab | //text:tab-stop | //text:a");
path.addNamespace("text", root.getNamespace("text").getURI());
Namespace xlink = Namespace.getNamespace("xlink", "http://www.w3.org/1999/xlink");
List list = path.selectNodes(doc);
boolean lastp = true;
for (int i = 0; i < list.size(); i++) {
Element el = (Element)list.get(i);
String text = el.getText();
if (el.getName().equals("p")) {