// Copy all the nodes in the nodelist to be under the top element
copyNodes(nodeList, doc, doc.getDocumentElement());
// w3cDOM -> DTM -> DOMImpl
if (dom instanceof MultiDOM) {
final MultiDOM multiDOM = (MultiDOM) dom;
DTMDefaultBase dtm = (DTMDefaultBase)((DOMAdapter)multiDOM.getMain()).getDOMImpl();
DTMManager dtmManager = dtm.getManager();
DOM idom = (DOM)dtmManager.getDTM(new DOMSource(doc), false,
null, true, false);
// Create DOMAdapter and register with MultiDOM
DOMAdapter domAdapter = new DOMAdapter(idom,
translet.getNamesArray(),
translet.getUrisArray(),
translet.getTypesArray(),
translet.getNamespaceArray());
multiDOM.addDOMAdapter(domAdapter);
DTMAxisIterator iter1 = idom.getAxisIterator(Axis.CHILD);
DTMAxisIterator iter2 = idom.getAxisIterator(Axis.CHILD);
DTMAxisIterator iter = new AbsoluteIterator(
new StepIterator(iter1, iter2));