buf.append(name);
buf.append(XMLUtil.encode(name));
    public void writeXML(PrintWriter out, int indent) {        XMLUtil.printIndent(out, indent++);        StringBuffer buf = new StringBuffer("<action id=\"");        buf.append(getId());        buf.append("\"");        if ((name != null) && (name.length() > 0)) {            buf.append(" name=\"");            buf.append(name);            buf.append("\"");        }        if ((view != null) && (view.length() > 0)) {            buf.append(" view=\"");            buf.append(view);            buf.append("\"");        }        if (finish) {            buf.append(" finish=\"true\"");        }        if (autoExecute) {            buf.append(" auto=\"true\"");        }        buf.append(">");        out.println(buf.toString());        Iterator iter = metaAttributes.entrySet().iterator();        while (iter.hasNext()) {            Map.Entry entry = (Map.Entry) iter.next();            XMLUtil.printIndent(out, indent);            out.print("<meta name=\"");            out.print(entry.getKey());            out.print("\">");            out.print(entry.getValue());            out.println("</meta>");        }        if (restriction != null) {            restriction.writeXML(out, indent);        }        if (validators.size() > 0) {            XMLUtil.printIndent(out, indent++);            out.println("<validators>");            for (int i = 0; i < validators.size(); i++) {                ValidatorDescriptor validator = (ValidatorDescriptor) validators.get(i);                validator.writeXML(out, indent);            }            XMLUtil.printIndent(out, --indent);            out.println("</validators>");        }        if (preFunctions.size() > 0) {            XMLUtil.printIndent(out, indent++);            out.println("<pre-functions>");            for (int i = 0; i < preFunctions.size(); i++) {                FunctionDescriptor function = (FunctionDescriptor) preFunctions.get(i);                function.writeXML(out, indent);            }            XMLUtil.printIndent(out, --indent);            out.println("</pre-functions>");        }        XMLUtil.printIndent(out, indent++);        out.println("<results>");        for (int i = 0; i < conditionalResults.size(); i++) {            ConditionalResultDescriptor result = (ConditionalResultDescriptor) conditionalResults.get(i);            result.writeXML(out, indent);        }        if (unconditionalResult != null) {            unconditionalResult.writeXML(out, indent);        }        XMLUtil.printIndent(out, --indent);        out.println("</results>");        if (postFunctions.size() > 0) {            XMLUtil.printIndent(out, indent++);            out.println("<post-functions>");            for (int i = 0; i < postFunctions.size(); i++) {                FunctionDescriptor function = (FunctionDescriptor) postFunctions.get(i);                function.writeXML(out, indent);            }            XMLUtil.printIndent(out, --indent);            out.println("</post-functions>");        }        XMLUtil.printIndent(out, --indent);        out.println("</action>");    }