// and elem was not handled by a module
&& null == ext.getModule(elem.getNamespaceURI())) {
// save it as foreign markup,
// but we can't detach it while we're iterating
foreignMarkup.add(elem.clone());
}
}
// Now we can detach the foreign markup elements
Iterator fm = foreignMarkup.iterator();
while (fm.hasNext()) {