Index: /branches/New Persistence Exploration/Persistence/Persistence/Core/DataMemberAccessor.cs
===================================================================
--- /branches/New Persistence Exploration/Persistence/Persistence/Core/DataMemberAccessor.cs	(revision 1434)
+++ /branches/New Persistence Exploration/Persistence/Persistence/Core/DataMemberAccessor.cs	(revision 1435)
@@ -5,8 +5,8 @@
 namespace HeuristicLab.Persistence {
 
+  public delegate object Getter();
+  public delegate void Setter(object value);
+
   public class DataMemberAccessor {
-
-    public delegate object Getter();
-    public delegate void Setter(object value);
 
     public readonly Getter Get;
Index: /branches/New Persistence Exploration/Persistence/Persistence/Core/DeSerializer.cs
===================================================================
--- /branches/New Persistence Exploration/Persistence/Persistence/Core/DeSerializer.cs	(revision 1434)
+++ /branches/New Persistence Exploration/Persistence/Persistence/Core/DeSerializer.cs	(revision 1435)
@@ -5,6 +5,5 @@
 namespace HeuristicLab.Persistence.Core {  
 
-  public struct ParentReference {}
-  delegate void Setter(object value);  
+  public struct ParentReference {}  
 
   class CompositeObject {
@@ -121,5 +120,5 @@
       Type type = typeIds[(int)primitive.TypeId];
       object value = ((IFormatter) serializerMapping[type]).Parse(primitive.SerialData);
-      if ( ! value.GetType().IsValueType )
+      if ( primitive.Id != null )      
         id2obj[(int)primitive.Id] = value;
       SetValue(primitive.Name, value);
Index: /branches/New Persistence Exploration/Persistence/Persistence/Default/Decomposers/EnumerableDecomposer.cs
===================================================================
--- /branches/New Persistence Exploration/Persistence/Persistence/Default/Decomposers/EnumerableDecomposer.cs	(revision 1434)
+++ /branches/New Persistence Exploration/Persistence/Persistence/Default/Decomposers/EnumerableDecomposer.cs	(revision 1435)
@@ -8,7 +8,47 @@
 namespace HeuristicLab.Persistence.Default.Decomposers {
 
-  public abstract class EnumerableDecomposer : IDecomposer {
+  public class EnumerableCache {    
 
-    public abstract void PerformAdd(object instance, MethodInfo addMethod, Tag tag);
+    List<object> values;
+    int nSet;
+    int count;
+    object enumerable;
+    MethodInfo addMethod;
+
+    public EnumerableCache(object enumerable, MethodInfo addMethod) {      
+      values = new List<object>();
+      this.enumerable = enumerable;
+      this.addMethod = addMethod;
+      count = -1;
+    }
+
+    public Setter GetNextSetter() {      
+      int index = values.Count;      
+      values.Add(new object());
+      return (v) => Set(index, v);
+    }
+
+    private void Set(int index, object value) {      
+      values[index] = value;
+      nSet += 1;
+      if (count >= 0 && nSet >= count)
+        Fill();
+    }
+
+    public void Terminate() {
+      count = values.Count;      
+      if (nSet >= count)
+        Fill();
+    }
+
+    private void Fill() {      
+      foreach ( object v in values ) {
+        addMethod.Invoke(enumerable, new[] {v});
+      }
+    }
+
+  }
+
+  public class EnumerableDecomposer : IDecomposer {    
 
     public bool CanDecompose(Type type) {
@@ -36,30 +76,13 @@
     public object Populate(object instance, IEnumerable<Tag> tags, Type type) {
       MethodInfo addMethod = type.GetMethod("Add");
+      EnumerableCache cache = new EnumerableCache(instance, addMethod);
       foreach (var tag in tags) {
-        PerformAdd(instance, addMethod, tag);        
+        tag.SafeSet(cache.GetNextSetter());
       }
+      cache.Terminate();
       return instance;
     }
 
-  }
-
-  /// <summary>
-  /// Does never re-order elements but cannot reconstruct enumerables that directly
-  /// or indirectly contain references to not-yet-contructed parent objects (e.g. arrays).
-  /// </summary>
-  public class SafeEnumerableDecomposer : EnumerableDecomposer {
-    public override void PerformAdd(object instance, MethodInfo addMethod, Tag tag) {
-      addMethod.Invoke(instance, new[] { tag.Value });
-    }
-  }
-  /// <summary>
-  /// May re-order elements if the enumerable contains references to
-  /// not-yet-constructed parent objects (e.g. arrays).
-  /// </summary>
-  public class RobustEnumerableDecomposer : EnumerableDecomposer {
-     public override void PerformAdd(object instance, MethodInfo addMethod, Tag tag) {
-      tag.SafeSet((value) => addMethod.Invoke(instance, new[] { value }));
-    }    
-  }
+  }  
 
 }
Index: /branches/New Persistence Exploration/Persistence/Persistence/Interfaces/IDecomposer.cs
===================================================================
--- /branches/New Persistence Exploration/Persistence/Persistence/Interfaces/IDecomposer.cs	(revision 1434)
+++ /branches/New Persistence Exploration/Persistence/Persistence/Interfaces/IDecomposer.cs	(revision 1435)
@@ -19,5 +19,5 @@
       this.Value = value;
     }
-    public void SafeSet(DataMemberAccessor.Setter setter) {
+    public void SafeSet(Setter setter) {
       if ( Value != null && Value.GetType() == typeof(ParentReference))
         finalFixes.Add(() => setter(Value));
Index: /branches/New Persistence Exploration/Persistence/Test/NewSerializationTest.cs
===================================================================
--- /branches/New Persistence Exploration/Persistence/Test/NewSerializationTest.cs	(revision 1434)
+++ /branches/New Persistence Exploration/Persistence/Test/NewSerializationTest.cs	(revision 1435)
@@ -182,4 +182,21 @@
     }
 
+    public static void Test4() {
+      ArrayList[] arrayListArray = new ArrayList[3];
+      arrayListArray[0] = new ArrayList();
+      arrayListArray[0].Add(arrayListArray);
+      arrayListArray[0].Add(arrayListArray);
+      arrayListArray[1] = new ArrayList();
+      arrayListArray[1].Add(arrayListArray);
+      arrayListArray[2] = new ArrayList();
+      arrayListArray[2].Add(arrayListArray);
+      arrayListArray[2].Add(arrayListArray);
+      XmlGenerator.Serialize(arrayListArray, "test4");
+      object o = XmlParser.DeSerialize("test4");
+      Console.Out.WriteLine(Util.AutoFormat(o, true));
+      Console.WriteLine(ViewOnlyGenerator.Serialize(arrayListArray));
+      Console.WriteLine(ViewOnlyGenerator.Serialize(o));
+    }
+
     public static void Test2() {
       Manager m = new Manager();      
@@ -212,6 +229,7 @@
     public static void Main() {            
       Test1();      
-      //Test2();
+      Test2();
       Test3();
+      Test4();
       //SpeedTest();
       //SpeedTest2();
