org.xml.sax.helpers.AttributesImpl atl = new org.xml.sax.helpers.AttributesImpl();
atl.addAttribute("","name","name", "CDATA", channelName);
// add other attributes: hasHelp, hasAbout, hasEdit
th.startDocument();
th.startElement("","channel","channel", atl);
ChannelSAXStreamFilter custodian = new ChannelSAXStreamFilter(th);
custodian.setParent(buffer);
buffer.stopBuffering(); buffer.outputBuffer();
th.endElement("","channel","channel");
th.endDocument();
} catch (SAXException e) {
// worst case scenario: partial content output :(