Thread.currentThread().setContextClassLoader(bundleClassLoader);
try {
XMLWriter writer = new XMLWriter(new OutputStreamWriter(outputStream));
MutableContext context = new DefaultMutableContext();
context.put(MyDoggyToolWindowManager.class, toolWindowManager);
context.put(PersistenceDelegateFilter.class, (filter != null) ? filter : dummyFilter);
context.put(InternalPersistenceDelegateFilter.class,
(filter != null)
? (filter instanceof InternalPersistenceDelegateFilter ? filter : new InternalPersistenceDelegateFilterWrapper(filter))
: dummyFilter);
context.put("standalone", standalone);
masterElementWriter.write(writer, context);
writer.flush();
} catch (Exception e) {