org.w3c.dom.Document dom = element.getOwnerDocument();
ContextAdapter ctx = new ContextAdapter(JXPathContext.newContext(element));
if (!editingDefault) {
ctx.setValue("name", nameText.getText());
}
ctx.removeAll("category");
Pointer p = ctx.getPointer("description|schedule|transform|autoBookmark");
for (int i = 0; i < categories.length; i++) {
Element category = (Element) dom.createElement("category");
category.appendChild(dom.createTextNode(categories[i]));