WriterItemDestination dest = new WriterItemDestination(w,getCharacterSet().toString());
ItemConstructor constructor = InfosetFactory.getDefaultInfoset().createItemConstructor();
dest.send(constructor.createDocument());
dest.send(constructor.createElement(root));
while (iter.hasNext()) {
DBObject obj = iter.next();
if (obj instanceof XMLObject) {
((XMLObject)obj).generate(constructor,dest,contents);
}
}
dest.send(constructor.createElementEnd(root));