throws SQLException,IOException,XMLException
{
Iterator<Feed> feeds = getFeeds();
ItemConstructor constructor = InfosetFactory.getDefaultInfoset().createItemConstructor();
dest.send(constructor.createDocument());
Element service = constructor.createElement(XML.SERVICE);
service.addNamespaceBinding(Name.NO_PREFIX,AtomResource.APP_NAMESPACE);
service.addNamespaceBinding("atom",AtomResource.ATOM_NAMESPACE);
if (xmlBase!=null) {
service.setBaseURI(URI.create(xmlBase));
service.setAttributeValue(Attribute.XML_BASE, xmlBase);
}
dest.send(service);
dest.send(constructor.createElement(XML.WORKSPACE));
dest.send(constructor.createElement(AtomResource.TITLE_NAME));
dest.send(constructor.createCharacters("Feeds"));
dest.send(constructor.createElementEnd(AtomResource.TITLE_NAME));
while (feeds.hasNext()) {
Feed feed = feeds.next();
String href = locator.makeHref(feed);
String title = storage.getFeedTitle(feed.getPath(),feed.getUUID());
Element collection = constructor.createElement(XML.COLLECTION);
collection.setAttributeValue("href",basePath+href);
dest.send(collection);
dest.send(constructor.createElement(AtomResource.TITLE_NAME));
if (title!=null) {
dest.send(constructor.createCharacters(title));
}