assertNotNull(root);
for (Iterator<DocumentImpl> i = root.iterator(broker); i.hasNext(); ) {
DocumentImpl doc = i.next();
root.removeXMLResource(transaction, broker, doc.getURI().lastSegment());
}
broker.saveCollection(transaction, root);
for (Iterator<XmldbURI> i = root.collectionIterator(broker); i.hasNext(); ) {
XmldbURI childName = i.next();
if (childName.equals("system"))
continue;
Collection childColl = broker.getOrCreateCollection(transaction, XmldbURI.ROOT_COLLECTION_URI.append(childName));