if (plan instanceof TaskPlan) {
TaskPlan tp = (TaskPlan) plan;
xw.writeStartElement("TASK");
xw.writeAttribute("ID", tp.getTask().toString());
} else if (plan instanceof DecompositionPlan) {
DecompositionPlan dp = (DecompositionPlan) plan;
xw.writeStartElement("RECIPE");
xw.writeAttribute("ID", dp.getType().toString());
} else if (plan instanceof StepPlan) {
StepPlan sp = (StepPlan) plan;
xw.writeStartElement("STEP");
xw.writeAttribute("NAME", sp.getName());
} else