writeNodeInstance( context,
subNodeInstance );
}
stream.writeShort( PersisterEnums.END );
} else if ( nodeInstance instanceof ForEachNodeInstance ) {
stream.writeShort( PersisterEnums.FOR_EACH_NODE_INSTANCE );
ForEachNodeInstance forEachNodeInstance = (ForEachNodeInstance) nodeInstance;
List<NodeInstance> nodeInstances = new ArrayList<NodeInstance>( forEachNodeInstance.getNodeInstances() );
Collections.sort( nodeInstances,
new Comparator<NodeInstance>() {
public int compare(NodeInstance o1,