List stateElements = XPath.newInstance("/process/description/output/state").selectNodes(rootElement);
List states = new ArrayList();
for ( Iterator i = stateElements.iterator(); i.hasNext(); ) {
Element stateElement = (Element)i.next();
String description = stateElement.getAttributeValue("description");
states.add(new StateDescriptor(stateElement.getTextTrim(), new DefaultMessage(description)));
}
resultDescriptor = new ResultDescriptor((StateDescriptor [])states.toArray(new StateDescriptor[states.size()]), (ResultEntryDescriptor[])resultEntryDescriptors.toArray(new ResultEntryDescriptor[resultEntryDescriptors.size()]));
List providedEnvironmentElements = XPath.newInstance("/process/description/output/environment").selectNodes(rootElement);
List providedEnvironment = new ArrayList();
for ( Iterator i = providedEnvironmentElements.iterator(); i.hasNext(); ) {