}
// Otherwise we must create a union iterator, add the nodes from
// all the DOMs to this iterator, and return the union in the end.
else if (arg instanceof NodeIterator) {
UnionIterator union = new UnionIterator(dom);
NodeIterator iterator = (NodeIterator)arg;
int node;
while ((node = iterator.next()) != DOM.NULL) {
String uri = dom.getNodeValue(node);
// Get the URI from this node if no xml URI base is set
if ((xmlURI == null) || xmlURI.equals("")) {
xmlURI = dom.getDocumentURI(node);
final int sep = xmlURI.lastIndexOf('/') + 1;