throws IOException
{
final ItemDestination dest = new WriterItemDestination(new OutputStreamWriter(os,"UTF-8"),"UTF-8");
final ItemConstructor constructor = InfosetFactory.getDefaultInfoset().createItemConstructor();
try {
context.execute(new QueryContext.ResultListener() {
DocumentLoader loader = new SAXDocumentLoader();
public void onStart() throws QueryException {
try {
dest.send(constructor.createDocument());
dest.send(constructor.createElement(AtomResource.FEED_NAME));