ByteArrayOutputStream out = new ByteArrayOutputStream();
XMLSerializer ser = new XMLSerializer(out, new OutputFormat("xml", "UTF-8", true));
ser.startDocument();
AttributesImpl attrs = new AttributesImpl();
attrs.addAttribute(null, null, ATTR_VERSION, "CDATA", String.valueOf(version));
ser.startElement(null, null, "workspaceFilter", attrs);
for (PathFilterSet set: filterSets) {
attrs = new AttributesImpl();
attrs.addAttribute(null, null, "root", "CDATA", set.getRoot());
if (set.getImportMode() != ImportMode.REPLACE) {
attrs.addAttribute(null, null, "mode", "CDATA", set.getImportMode().name().toLowerCase());