}
ostream = new FileOutputStream(filename);
for (Iterator iter = paletteItemManager.getAllCategories().iterator(); iter.hasNext();) {
TaglibPaletteDrawer category = (TaglibPaletteDrawer) iter
.next();
if (category == null) continue;
Element categoryElement = document.createElement(IPaletteConstants.CATEGORY_TAG);
categoryElement.setAttribute(IPaletteConstants.ID, category.getURI());
categoryElement.setAttribute(IPaletteConstants.ISHIDDEN, Boolean.toString(! category.isVisible()));
document.getDocumentElement().appendChild(categoryElement);
}
XMLUtil.serialize(document, ostream);
ostream.close();
} catch (IOException e) {