Index: /branches/New Persistence Exploration/Persistence/Persistence/Core/DeSerializer.cs
===================================================================
--- /branches/New Persistence Exploration/Persistence/Persistence/Core/DeSerializer.cs	(revision 1360)
+++ /branches/New Persistence Exploration/Persistence/Persistence/Core/DeSerializer.cs	(revision 1361)
@@ -16,10 +16,10 @@
 
 
-  class CustomObject : IAccessibleObject {
+  class CustomComposite : IAccessibleObject {
 
     public object Obj { get; private set; }
     public readonly List<object> customValues;
 
-    public CustomObject(object obj) {
+    public CustomComposite(object obj) {
       Obj = obj;
       customValues = new List<object>();
@@ -37,10 +37,10 @@
 
 
-  class CompositeObject : IAccessibleObject {
+  class StorableComposite : IAccessibleObject {
 
     public object Obj { get; private set; }
     public readonly Dictionary<string, DataMemberAccessor> accessorDict;
 
-    public CompositeObject(object obj, Dictionary<string, DataMemberAccessor> accessorDict) {
+    public StorableComposite(object obj, Dictionary<string, DataMemberAccessor> accessorDict) {
       Obj = obj;
       this.accessorDict = new Dictionary<string, DataMemberAccessor>();
@@ -76,5 +76,5 @@
     private readonly Dictionary<int, object> id2obj;
     private readonly Dictionary<Type, Handler> handlers;
-    private readonly Stack<IAccessibleObject> compositeStack;
+    private readonly Stack<IAccessibleObject> parentStack;
     private readonly Configuration configuration;
     private readonly Dictionary<int, Type> typeIds;    
@@ -86,5 +86,5 @@
       this.configuration = configuration;
       id2obj = new Dictionary<int, object>();
-      compositeStack = new Stack<IAccessibleObject>();
+      parentStack = new Stack<IAccessibleObject>();
       handlers = new Dictionary<Type, Handler> {
                      {typeof (BeginToken), CompositeStartHandler},
@@ -109,5 +109,5 @@
         fix();
       }
-      return compositeStack.Pop().Obj;
+      return parentStack.Pop().Obj;
     }
 
@@ -118,10 +118,10 @@
       if (configuration.GetDecomposer(type) != null) {
         instance = new ParentReference();
-        compositeStack.Push(new CustomObject(instance));        
+        parentStack.Push(new CustomComposite(instance));        
       } else {        
         instance = Activator.CreateInstance(type, true);
         Dictionary<string, DataMemberAccessor> accessorDict =
           StorableAttribute.GetAutostorableAccessors(instance);
-        compositeStack.Push(new CompositeObject(instance, accessorDict));        
+        parentStack.Push(new StorableComposite(instance, accessorDict));        
       }
       if ( start.Id != null )
@@ -134,14 +134,14 @@
       IDecomposer decomposer = configuration.GetDecomposer(type);
       if (decomposer != null) {
-        CustomObject customObject = (CustomObject)compositeStack.Pop();
+        CustomComposite customComposite = (CustomComposite)parentStack.Pop();
         object deserializedObject =
-          decomposer.Compose(customObject.customValues, type);
+          decomposer.Compose(customComposite.customValues, type);
         if ( end.Id != null )
           id2obj[(int)end.Id] = deserializedObject;        
         SetValue(end.Name, deserializedObject);          
       } else {
-        CompositeObject compositeObject = (CompositeObject)compositeStack.Pop();
-        compositeObject.PopulateDefaultValues();
-        SetValue(end.Name, compositeObject.Obj);
+        StorableComposite storableComposite = (StorableComposite)parentStack.Pop();
+        storableComposite.PopulateDefaultValues();
+        SetValue(end.Name, storableComposite.Obj);
       }
     }
@@ -163,5 +163,5 @@
       SetValue(reference.Name, id2obj[reference.Id]);
       if (referredObject is ParentReference) {
-        Setter set = compositeStack.Peek().GetSetter(reference.Name);        
+        Setter set = parentStack.Peek().GetSetter(reference.Name);        
         int id = reference.Id;
         finalFixes.Add(() => set(id2obj[id]));
@@ -175,12 +175,12 @@
 
     private void SetValue(string name, object value) {
-      if (compositeStack.Count == 0) {
-        compositeStack.Push(new CompositeObject(value, new Dictionary<string, DataMemberAccessor>()));
+      if (parentStack.Count == 0) {
+        parentStack.Push(new StorableComposite(value, new Dictionary<string, DataMemberAccessor>()));
       } else {
-        object accessibleObject = compositeStack.Peek();
-        if (accessibleObject is CompositeObject) {
-          ((CompositeObject)accessibleObject).SetValue(name, value);
-        } else if (accessibleObject is CustomObject) {
-          ((CustomObject)accessibleObject).AddValue(value);
+        object accessibleObject = parentStack.Peek();
+        if (accessibleObject is StorableComposite) {
+          ((StorableComposite)accessibleObject).SetValue(name, value);
+        } else if (accessibleObject is CustomComposite) {
+          ((CustomComposite)accessibleObject).AddValue(value);
         }
       }
Index: /branches/New Persistence Exploration/Persistence/Persistence/Core/Serializer.cs
===================================================================
--- /branches/New Persistence Exploration/Persistence/Persistence/Core/Serializer.cs	(revision 1360)
+++ /branches/New Persistence Exploration/Persistence/Persistence/Core/Serializer.cs	(revision 1361)
@@ -45,12 +45,11 @@
         yield return iterator.Current;      
     }
-
     
     private IEnumerator<ISerializationToken> Serialize(DataMemberAccessor accessor) {
       object value = accessor.Get();
       if (value == null)
-        return NullReferenceEnumeration(accessor.Name);
+        return NullReferenceEnumerator(accessor.Name);
       if (obj2id.ContainsKey(value))
-        return ReferenceTokenEnumeration(accessor.Name, obj2id[value]);              
+        return ReferenceEnumerator(accessor.Name, obj2id[value]);              
       if ( ! typeCache.ContainsKey(value.GetType()))
         typeCache.Add(value.GetType(), typeCache.Count);
@@ -63,24 +62,26 @@
       IFormatter formatter = configuration.GetFormatter(value.GetType());
       if (formatter != null)
-        return PrimitiveEnumeration(accessor.Name, typeId, formatter.DoFormat(value), id);
+        return PrimitiveEnumerator(accessor.Name, typeId, formatter.DoFormat(value), id);
       IDecomposer decomposer = configuration.GetDecomposer(value.GetType()); 
       if (decomposer != null)
-        return CompositeEnumeration(accessor.Name, decomposer.DeCompose(value), id, typeId);            
-      return StorableEnumeration(accessor.Name, value, id, typeId);
+        return CompositeEnumerator(accessor.Name, decomposer.DeCompose(value), id, typeId);            
+      return StorableEnumerator(accessor.Name, value, id, typeId);
     }
 
-    private IEnumerator<ISerializationToken> NullReferenceEnumeration(string name) {
+    private IEnumerator<ISerializationToken> NullReferenceEnumerator(string name) {
       yield return new NullReferenceToken(name);
     }
 
-    private IEnumerator<ISerializationToken> ReferenceTokenEnumeration(string name, int id) {
+    private IEnumerator<ISerializationToken> ReferenceEnumerator(string name, int id) {
       yield return new ReferenceToken(name, id);
     }
 
-    private IEnumerator<ISerializationToken> PrimitiveEnumeration(string name, int typeId, object serializedValue, int? id) {
+    private IEnumerator<ISerializationToken> PrimitiveEnumerator(string name,
+        int typeId, object serializedValue, int? id) {
       yield return new PrimitiveToken(name, typeId, serializedValue, id);
     }
 
-    private IEnumerator<ISerializationToken> CompositeEnumeration(string name, IEnumerable values, int? id, int typeId) {
+    private IEnumerator<ISerializationToken> CompositeEnumerator(string name,
+        IEnumerable values, int? id, int typeId) {
       yield return new BeginToken(name, typeId, id);      
         foreach (object o in values) {
@@ -92,10 +93,11 @@
     }
 
-    private IEnumerator<ISerializationToken> StorableEnumeration(string name, object value, int? id, int typeId) {            
+    private IEnumerator<ISerializationToken> StorableEnumerator(string name,
+        object value, int? id, int typeId) {            
       yield return new BeginToken(name, typeId, id);
       int nSubComponents = 0;
       foreach (KeyValuePair<string, DataMemberAccessor> mapping in
         StorableAttribute.GetAutostorableAccessors(value)) {
-        nSubComponents += 1;
+        nSubComponents += 1;                
         IEnumerator<ISerializationToken> iterator = Serialize(mapping.Value);
         while (iterator.MoveNext()) {
@@ -104,7 +106,8 @@
       }
       if (nSubComponents == 0) {
-        throw new ApplicationException(String.Format(
-                                         "Composite value of type \"{0}\" contains no subcomponents",
-                                         value.GetType().FullName));
+        throw new ApplicationException(
+          String.Format(
+            "CustomComposite value of type \"{0}\" contains no subcomponents",
+            value.GetType().FullName));
       }
       yield return new EndToken(name, typeId, id);
Index: anches/New Persistence Exploration/Persistence/Persistence/Default/Decomposers.cs
===================================================================
--- /branches/New Persistence Exploration/Persistence/Persistence/Default/Decomposers.cs	(revision 1360)
+++ 	(revision )
@@ -1,129 +1,0 @@
-﻿using System;
-using System.Collections;
-using System.Reflection;
-using System.Collections.Generic;
-using HeuristicLab.Persistence.Interfaces;
-
-namespace HeuristicLab.Persistence {
-  
-  public class EnumerableDecomposer : IDecomposer {
-
-    public bool CanDecompose(Type type) {
-      return
-        type.GetInterface("IEnumerable") != null &&
-        type.GetMethod("Add") != null &&
-        type.GetMethod("Add").GetParameters().Length == 1 &&
-        type.GetConstructor(
-          BindingFlags.Public |
-          BindingFlags.NonPublic |
-          BindingFlags.Instance,
-          null, Type.EmptyTypes, null) != null;        
-    }    
-
-    public IEnumerable DeCompose(object obj) {
-      return (IEnumerable)obj;
-    }
-
-    public object Compose(IEnumerable objects, Type type) {
-      object instance = Activator.CreateInstance(type, true);
-      MethodInfo addMethod = type.GetMethod("Add");
-      foreach (object o in objects) {
-        addMethod.Invoke(instance, new[] {o});        
-      }
-      return instance;
-    }
-
-  }
-
-
-  public class ArrayDecomposer : IDecomposer {
-
-    public bool CanDecompose(Type type) {
-      return type.IsArray || type == typeof(Array);
-    }
-
-    public IEnumerable DeCompose(object array) {
-      Array a = (Array)array;
-      yield return a.Rank;
-      for (int i = 0; i < a.Rank; i++) {
-        yield return a.GetLength(i);
-      }
-      foreach (object o in (Array)array) {
-        yield return o;
-      }
-    }
-
-    public object Compose(IEnumerable elements, Type t) {
-      IEnumerator e = elements.GetEnumerator();
-      e.MoveNext();
-      int rank = (int)e.Current;
-      int[] lengths = new int[rank];
-      for (int i = 0; i < rank; i++) {
-        e.MoveNext();
-        lengths[i] = (int)e.Current;
-      }
-      Array a = Array.CreateInstance(t.GetElementType(), lengths);      
-      int[] positions = new int[rank];
-      while (e.MoveNext()) {
-        a.SetValue(e.Current, positions);
-        positions[0] += 1;
-        for (int i = 0; i < rank-1; i++) {
-          if (positions[i] >= lengths[i]) {
-            positions[i] = 0;
-            positions[i + 1] += 1;
-          } else {
-            break;
-          }
-        }
-      }
-      return a;
-    }
-  }
-
-
-  public class KeyValuePairDecomposer : IDecomposer {    
-
-    public bool CanDecompose(Type type) {
-      return type.IsGenericType &&
-             type.GetGenericTypeDefinition() == 
-             typeof (KeyValuePair<int, int>).GetGenericTypeDefinition();
-    }
-
-    public IEnumerable DeCompose(object o) {      
-      Type t = o.GetType();
-      yield return t.GetProperty("Key").GetValue(o, null);
-      yield return t.GetProperty("Value").GetValue(o, null);
-    }
-
-    public object Compose(IEnumerable o, Type t) {      
-      return Activator.CreateInstance(t,
-        new List<object>((IEnumerable<object>)o).ToArray());
-    }    
-  }
-
-
-  public class DictionaryDecomposer : IDecomposer {
-    public bool CanDecompose(Type type) {
-      return type.GetInterface("IDictionary") != null;        
-    }
-    public IEnumerable DeCompose(object o) {
-      IDictionary dict = (IDictionary)o;      
-      foreach ( DictionaryEntry entry in dict) {
-        yield return entry.Key;
-        yield return entry.Value;
-      }
-    }
-    public object Compose(IEnumerable o, Type t) {
-      IDictionary dict = (IDictionary)Activator.CreateInstance(t, true);
-      IEnumerator iter = o.GetEnumerator();
-      while (iter.MoveNext()) {
-        object key = iter.Current;
-        iter.MoveNext();
-        object value = iter.Current;
-        dict.Add(key, value);
-      }
-      return dict;
-    }
-  }
-
-}
Index: /branches/New Persistence Exploration/Persistence/Persistence/Default/Decomposers/ArrayDecomposer.cs
===================================================================
--- /branches/New Persistence Exploration/Persistence/Persistence/Default/Decomposers/ArrayDecomposer.cs	(revision 1361)
+++ /branches/New Persistence Exploration/Persistence/Persistence/Default/Decomposers/ArrayDecomposer.cs	(revision 1361)
@@ -0,0 +1,51 @@
+﻿using System;
+using System.Collections;
+using HeuristicLab.Persistence.Interfaces;
+
+namespace HeuristicLab.Persistence.Default.Decomposers {
+  
+  public class ArrayDecomposer : IDecomposer {
+
+    public bool CanDecompose(Type type) {
+      return type.IsArray || type == typeof(Array);
+    }
+
+    public IEnumerable DeCompose(object array) {
+      Array a = (Array)array;
+      yield return a.Rank;
+      for (int i = 0; i < a.Rank; i++) {
+        yield return a.GetLength(i);
+      }
+      foreach (object o in (Array)array) {
+        yield return o;
+      }
+    }
+
+    public object Compose(IEnumerable elements, Type t) {
+      IEnumerator e = elements.GetEnumerator();
+      e.MoveNext();
+      int rank = (int)e.Current;
+      int[] lengths = new int[rank];
+      for (int i = 0; i < rank; i++) {
+        e.MoveNext();
+        lengths[i] = (int)e.Current;
+      }
+      Array a = Array.CreateInstance(t.GetElementType(), lengths);      
+      int[] positions = new int[rank];
+      while (e.MoveNext()) {
+        a.SetValue(e.Current, positions);
+        positions[0] += 1;
+        for (int i = 0; i < rank-1; i++) {
+          if (positions[i] >= lengths[i]) {
+            positions[i] = 0;
+            positions[i + 1] += 1;
+          } else {
+            break;
+          }
+        }
+      }
+      return a;
+    }
+  }
+  
+}
Index: /branches/New Persistence Exploration/Persistence/Persistence/Default/Decomposers/DictionaryDecomposer.cs
===================================================================
--- /branches/New Persistence Exploration/Persistence/Persistence/Default/Decomposers/DictionaryDecomposer.cs	(revision 1361)
+++ /branches/New Persistence Exploration/Persistence/Persistence/Default/Decomposers/DictionaryDecomposer.cs	(revision 1361)
@@ -0,0 +1,34 @@
+﻿using System;
+using System.Collections;
+using HeuristicLab.Persistence.Interfaces;
+
+namespace HeuristicLab.Persistence.Default.Decomposers {  
+
+  public class DictionaryDecomposer : IDecomposer {
+
+    public bool CanDecompose(Type type) {
+      return type.GetInterface(typeof(IDictionary).FullName) != null;        
+    }
+
+    public IEnumerable DeCompose(object o) {
+      IDictionary dict = (IDictionary)o;      
+      foreach ( DictionaryEntry entry in dict) {
+        yield return entry.Key;
+        yield return entry.Value;
+      }
+    }
+
+    public object Compose(IEnumerable o, Type t) {
+      IDictionary dict = (IDictionary)Activator.CreateInstance(t, true);
+      IEnumerator iter = o.GetEnumerator();
+      while (iter.MoveNext()) {
+        object key = iter.Current;
+        iter.MoveNext();
+        object value = iter.Current;
+        dict.Add(key, value);
+      }
+      return dict;
+    }
+  }
+
+}
Index: /branches/New Persistence Exploration/Persistence/Persistence/Default/Decomposers/EnumerableDecomposer.cs
===================================================================
--- /branches/New Persistence Exploration/Persistence/Persistence/Default/Decomposers/EnumerableDecomposer.cs	(revision 1361)
+++ /branches/New Persistence Exploration/Persistence/Persistence/Default/Decomposers/EnumerableDecomposer.cs	(revision 1361)
@@ -0,0 +1,37 @@
+﻿using System;
+using System.Collections;
+using System.Reflection;
+using HeuristicLab.Persistence.Interfaces;
+
+namespace HeuristicLab.Persistence.Default.Decomposers {
+  
+  public class EnumerableDecomposer : IDecomposer {
+
+    public bool CanDecompose(Type type) {
+      return
+        type.GetInterface(typeof(IEnumerable).FullName) != null &&
+        type.GetMethod("Add") != null &&
+        type.GetMethod("Add").GetParameters().Length == 1 &&
+        type.GetConstructor(
+          BindingFlags.Public |
+          BindingFlags.NonPublic |
+          BindingFlags.Instance,
+          null, Type.EmptyTypes, null) != null;        
+    }    
+
+    public IEnumerable DeCompose(object obj) {
+      return (IEnumerable)obj;
+    }
+
+    public object Compose(IEnumerable objects, Type type) {
+      object instance = Activator.CreateInstance(type, true);
+      MethodInfo addMethod = type.GetMethod("Add");
+      foreach (object o in objects) {
+        addMethod.Invoke(instance, new[] {o});        
+      }
+      return instance;
+    }
+
+  }
+
+}
Index: /branches/New Persistence Exploration/Persistence/Persistence/Default/Decomposers/KeyValuePairDecomposer.cs
===================================================================
--- /branches/New Persistence Exploration/Persistence/Persistence/Default/Decomposers/KeyValuePairDecomposer.cs	(revision 1361)
+++ /branches/New Persistence Exploration/Persistence/Persistence/Default/Decomposers/KeyValuePairDecomposer.cs	(revision 1361)
@@ -0,0 +1,28 @@
+﻿using System;
+using System.Collections;
+using System.Collections.Generic;
+using HeuristicLab.Persistence.Interfaces;
+
+namespace HeuristicLab.Persistence.Default.Decomposers {
+  
+  public class KeyValuePairDecomposer : IDecomposer {    
+
+    public bool CanDecompose(Type type) {
+      return type.IsGenericType &&
+             type.GetGenericTypeDefinition() == 
+             typeof (KeyValuePair<int, int>).GetGenericTypeDefinition();
+    }
+
+    public IEnumerable DeCompose(object o) {      
+      Type t = o.GetType();
+      yield return t.GetProperty("Key").GetValue(o, null);
+      yield return t.GetProperty("Value").GetValue(o, null);
+    }
+
+    public object Compose(IEnumerable o, Type t) {      
+      return Activator.CreateInstance(t,
+        new List<object>((IEnumerable<object>)o).ToArray());
+    }    
+  }
+
+}
Index: anches/New Persistence Exploration/Persistence/Persistence/Default/EnumerableFormatters.cs
===================================================================
--- /branches/New Persistence Exploration/Persistence/Persistence/Default/EnumerableFormatters.cs	(revision 1360)
+++ 	(revision )
@@ -1,56 +1,0 @@
-﻿using System.Collections;
-using System.Collections.Generic;
-using System.Text;
-using HeuristicLab.Persistence.Interfaces;
-using System;
-
-namespace HeuristicLab.Persistence {
-  
-
-  public abstract class NumberEnumeration2XmlFormatter : IFormatter {
-
-    public abstract Type Type { get; }
-    public IFormat Format { get { return XmlFormat.Instance; } }
-    protected virtual string Separator { get { return ";"; } }
-    protected abstract void Add(IEnumerable enumeration, object o);
-    protected abstract object Instantiate();
-    protected abstract string formatValue(object o);
-    protected abstract object parseValue(string o);
-
-    public object DoFormat(object o) {
-      StringBuilder sb = new StringBuilder();
-      foreach (var value in (IEnumerable)o) {
-        sb.Append(formatValue(value));
-        sb.Append(Separator);
-      }
-      return sb.ToString();
-    }
-
-    public object Parse(object o) {
-      IEnumerable enumeration = (IEnumerable)Instantiate();
-      string[] values = ((string)o).Split(new[] { Separator }, StringSplitOptions.RemoveEmptyEntries);
-      foreach (var value in values) {
-        Add(enumeration, parseValue(value));
-      }
-      return enumeration;
-    }
-  }
-
-
-  public class IntList2XmlFormatter : NumberEnumeration2XmlFormatter {
-    public override Type Type { get { return typeof(List<int>); } }
-    protected override void Add(IEnumerable enumeration, object o) { ((List<int>)enumeration).Add((int)o); }
-    protected override object Instantiate() { return new List<int>(); }
-    protected override string formatValue(object o) { return o.ToString(); }
-    protected override object parseValue(string o) { return int.Parse(o); }
-  }
-
-
-  public class DoubleList2XmlFormatter : NumberEnumeration2XmlFormatter {
-    public override Type Type { get { return typeof(List<double>); } }
-    protected override void Add(IEnumerable enumeration, object o) { ((List<double>)enumeration).Add((int)o); }
-    protected override object Instantiate() { return new List<double>(); }
-    protected override string formatValue(object o) { return ((double)o).ToString("r"); }
-    protected override object parseValue(string o) { return double.Parse(o); }
-  }
-}
Index: anches/New Persistence Exploration/Persistence/Persistence/Default/NumberArrayFormatters.cs
===================================================================
--- /branches/New Persistence Exploration/Persistence/Persistence/Default/NumberArrayFormatters.cs	(revision 1360)
+++ 	(revision )
@@ -1,95 +1,0 @@
-﻿using System.Collections;
-using System.Text;
-using HeuristicLab.Persistence.Interfaces;
-using System;
-
-namespace HeuristicLab.Persistence {
-                                                              
-  public abstract class NumberArray2XmlFormatter : IFormatter {
-
-    public abstract Type Type { get; }
-    public IFormat Format { get { return XmlFormat.Instance; } }
-    protected virtual string Separator { get { return ";"; } }
-    protected abstract string formatValue(object o);
-    protected abstract object parseValue(string o);
-
-    public object DoFormat(object obj) {
-      Array a = (Array)obj;
-      StringBuilder sb = new StringBuilder();
-      sb.Append(a.Rank);
-      for (int i = 0; i < a.Rank; i++) {
-        sb.Append(Separator);
-        sb.Append(a.GetLength(i));
-      }
-      foreach (object o in a) {
-        sb.Append(Separator);
-        sb.Append(formatValue(o));
-      }
-      return sb.ToString();
-    }
-
-    public object Parse(object o) {
-      IEnumerator values =
-        ((string)o)
-        .Split(new[] { Separator },
-        StringSplitOptions.RemoveEmptyEntries).GetEnumerator();
-      values.MoveNext();
-      int rank = int.Parse((string)values.Current);
-      int[] lengths = new int[rank];
-      for (int i = 0; i < rank; i++) {
-        values.MoveNext();
-        lengths[i] = int.Parse((string)values.Current);
-      }
-      Array a = Array.CreateInstance(this.Type.GetElementType(), lengths);
-      int[] positions = new int[rank];
-      while (values.MoveNext()) {
-        a.SetValue(parseValue((string)values.Current), positions);
-        positions[0] += 1;
-        for (int i = 0; i < rank - 1; i++) {
-          if (positions[i] >= lengths[i]) {
-            positions[i] = 0;
-            positions[i + 1] += 1;
-          } else {
-            break;
-          }
-        }
-      }
-      return a;
-    }
-  }
-
-
-  public class IntArray2XmlFormatter : NumberArray2XmlFormatter {
-    public override Type Type { get { return typeof(int[]); } }
-    protected override string formatValue(object o) { return o.ToString(); }
-    protected override object parseValue(string o) { return int.Parse(o); }
-  }
-
-
-  public class Int2DArray2XmlFormatter : IntArray2XmlFormatter {
-    public override Type Type { get { return typeof(int[,]); } }
-  }
-
-
-  public class Int3DArray2XmlFormatter : IntArray2XmlFormatter {
-    public override Type Type { get { return typeof(int[, ,]); } }
-  }
-
-
-  public class DoubleArray2XmlFormatter : NumberArray2XmlFormatter {
-    public override Type Type { get { return typeof(double[]); } }
-    protected override string formatValue(object o) { return ((double)o).ToString("r"); }
-    protected override object parseValue(string o) { return double.Parse(o); }
-  }
-
-
-  public class Double2DArray2XmlFormatter : DoubleArray2XmlFormatter {
-    public override Type Type { get { return typeof(double[,]); } }
-  }
-
-
-  public class Double3DArray2XmlFormatter : DoubleArray2XmlFormatter {
-    public override Type Type { get { return typeof(double[, ,]); } }
-  }
-  
-}
Index: anches/New Persistence Exploration/Persistence/Persistence/Default/PrimitiveFormatters.cs
===================================================================
--- /branches/New Persistence Exploration/Persistence/Persistence/Default/PrimitiveFormatters.cs	(revision 1360)
+++ 	(revision )
@@ -1,77 +1,0 @@
-﻿using System;
-using System.Text;
-using System.Globalization;
-using HeuristicLab.Persistence.Interfaces;
-
-namespace HeuristicLab.Persistence {
-
-  public class XmlFormat : IFormat {
-    public string Name { get { return "XML"; } }
-    public static readonly XmlFormat Instance = new XmlFormat();    
-  }
-
-  public class String2XmlFormatter : IFormatter {
-    public Type Type { get { return typeof(string); } }
-    public IFormat Format { get { return XmlFormat.Instance;  } }
-    public object DoFormat(object o) {      
-      return "<![CDATA[" +
-        ((string)o).Replace("]]>", "]]]]><![CDATA[>") +
-        "]]>";
-    }
-    public object Parse(object o) {
-      StringBuilder sb = new StringBuilder();
-      foreach (string s in ((string)o).Split(
-        new[] { "<![CDATA[", "]]>" },
-        StringSplitOptions.RemoveEmptyEntries)) {
-        sb.Append(s);
-      }
-      return sb.ToString();
-    }
-  }
-
-  public class Int2XmlFormatter : IFormatter {
-    public Type Type { get { return typeof(int); } }
-    public IFormat Format { get { return XmlFormat.Instance; } }
-    public object DoFormat(object o) {
-      return ((int)o).ToString();
-    }
-    public object Parse(object o) {
-      return int.Parse((string)o);
-    }
-  }
-
-  public class Double2XmlFormatter : IFormatter {    
-    public Type Type { get { return typeof(double); } }
-    public IFormat Format { get { return XmlFormat.Instance; } }
-    public object DoFormat(object o) {
-      return ((double)o).ToString("r", CultureInfo.InvariantCulture);      
-    }
-    public object Parse(object o) {
-      return double.Parse((string)o, CultureInfo.InvariantCulture);
-    }
-  }
-
-  public class Boolean2XmlFormatter : IFormatter {    
-    public Type Type { get { return typeof(bool); } }
-    public IFormat Format { get { return XmlFormat.Instance; } }
-    public object DoFormat(object o) {
-      return ((bool)o).ToString();
-    }
-    public object Parse(object o) {
-      return bool.Parse((string)o);
-    }
-  }
-
-  public class DateTime2XmlFormatter : IFormatter {    
-    public Type Type { get { return typeof(DateTime); } }
-    public IFormat Format { get { return XmlFormat.Instance; } }  
-    public object DoFormat(object o) {
-      return ((DateTime)o).Ticks.ToString();      
-    }
-    public object Parse(object o) {
-      return new DateTime(long.Parse((string)o));
-    }
-  }
-
-  
-}
Index: /branches/New Persistence Exploration/Persistence/Persistence/Default/Xml/Compact/DoubleArray2XmlFormatters.cs
===================================================================
--- /branches/New Persistence Exploration/Persistence/Persistence/Default/Xml/Compact/DoubleArray2XmlFormatters.cs	(revision 1361)
+++ /branches/New Persistence Exploration/Persistence/Persistence/Default/Xml/Compact/DoubleArray2XmlFormatters.cs	(revision 1361)
@@ -0,0 +1,40 @@
+﻿using System;
+
+namespace HeuristicLab.Persistence.Default.Xml.Compact {
+
+  public class DoubleArray2XmlFormatter : NumberArray2XmlFormatter {
+
+    public override Type Type {
+      get {
+        return typeof(double[]);
+      }
+    }
+
+    protected override string formatValue(object o) {
+      return ((double)o).ToString("r");
+    }
+
+    protected override object parseValue(string o) {
+      return double.Parse(o);
+    }
+  }
+
+
+  public class Double2DArray2XmlFormatter : DoubleArray2XmlFormatter {
+    public override Type Type {
+      get {
+        return typeof(double[,]);
+      }
+    }
+  }
+
+
+  public class Double3DArray2XmlFormatter : DoubleArray2XmlFormatter {
+    public override Type Type {
+      get {
+        return typeof(double[, ,]);
+      }
+    }
+  }
+  
+}
Index: /branches/New Persistence Exploration/Persistence/Persistence/Default/Xml/Compact/DoubleList2XmlFormatter.cs
===================================================================
--- /branches/New Persistence Exploration/Persistence/Persistence/Default/Xml/Compact/DoubleList2XmlFormatter.cs	(revision 1361)
+++ /branches/New Persistence Exploration/Persistence/Persistence/Default/Xml/Compact/DoubleList2XmlFormatter.cs	(revision 1361)
@@ -0,0 +1,32 @@
+﻿using System.Collections;
+using System.Collections.Generic;
+using System;
+
+namespace HeuristicLab.Persistence.Default.Xml.Compact {
+  
+  public class DoubleList2XmlFormatter : NumberEnumeration2XmlFormatter {
+
+    public override Type Type {
+      get {
+      return typeof(List<double>);
+      }
+    }
+
+    protected override void Add(IEnumerable enumeration, object o) {
+      ((List<double>)enumeration).Add((int)o);
+    }
+
+    protected override object Instantiate() {
+      return new List<double>();
+    }
+
+    protected override string formatValue(object o) {
+      return ((double)o).ToString("r");
+    }
+
+    protected override object parseValue(string o) {
+      return double.Parse(o);
+    }
+
+  }
+}
Index: /branches/New Persistence Exploration/Persistence/Persistence/Default/Xml/Compact/IntArray2XmlFormatters.cs
===================================================================
--- /branches/New Persistence Exploration/Persistence/Persistence/Default/Xml/Compact/IntArray2XmlFormatters.cs	(revision 1361)
+++ /branches/New Persistence Exploration/Persistence/Persistence/Default/Xml/Compact/IntArray2XmlFormatters.cs	(revision 1361)
@@ -0,0 +1,40 @@
+﻿using System;
+
+namespace HeuristicLab.Persistence.Default.Xml.Compact {
+                                                              
+  public class IntArray2XmlFormatter : NumberArray2XmlFormatter {
+
+    public override Type Type {
+      get {
+        return typeof(int[]);
+      }
+    }
+
+    protected override string formatValue(object o) {
+      return o.ToString();
+    }
+
+    protected override object parseValue(string o) {
+      return int.Parse(o);
+    }
+  }
+
+
+  public class Int2DArray2XmlFormatter : IntArray2XmlFormatter {
+    public override Type Type {
+      get {
+        return typeof(int[,]);
+      }
+    }
+  }
+
+
+  public class Int3DArray2XmlFormatter : IntArray2XmlFormatter {
+    public override Type Type {
+      get {
+        return typeof(int[, ,]);
+      }
+    }
+  }
+  
+}
Index: /branches/New Persistence Exploration/Persistence/Persistence/Default/Xml/Compact/IntList2XmlFormatter.cs
===================================================================
--- /branches/New Persistence Exploration/Persistence/Persistence/Default/Xml/Compact/IntList2XmlFormatter.cs	(revision 1361)
+++ /branches/New Persistence Exploration/Persistence/Persistence/Default/Xml/Compact/IntList2XmlFormatter.cs	(revision 1361)
@@ -0,0 +1,32 @@
+﻿using System.Collections;
+using System.Collections.Generic;
+using System;
+
+namespace HeuristicLab.Persistence.Default.Xml.Compact {
+  
+  public class IntList2XmlFormatter : NumberEnumeration2XmlFormatter {
+
+    public override Type Type {
+      get {
+        return typeof(List<int>);
+      }
+    }
+
+    protected override void Add(IEnumerable enumeration, object o) {
+      ((List<int>)enumeration).Add((int)o);
+    }
+
+    protected override object Instantiate() {
+      return new List<int>();
+    }
+
+    protected override string formatValue(object o) {
+      return o.ToString();
+    }
+
+    protected override object parseValue(string o) {
+      return int.Parse(o);
+    }
+  }
+
+}
Index: /branches/New Persistence Exploration/Persistence/Persistence/Default/Xml/Compact/NumberArray2XmlFormatters.cs
===================================================================
--- /branches/New Persistence Exploration/Persistence/Persistence/Default/Xml/Compact/NumberArray2XmlFormatters.cs	(revision 1361)
+++ /branches/New Persistence Exploration/Persistence/Persistence/Default/Xml/Compact/NumberArray2XmlFormatters.cs	(revision 1361)
@@ -0,0 +1,61 @@
+﻿using System.Collections;
+using System.Text;
+using HeuristicLab.Persistence.Interfaces;
+using System;
+
+namespace HeuristicLab.Persistence.Default.Xml.Compact {
+                                                              
+  public abstract class NumberArray2XmlFormatter : IFormatter {
+
+    public abstract Type Type { get; }
+    public IFormat Format { get { return XmlFormat.Instance; } }
+    protected virtual string Separator { get { return ";"; } }
+    protected abstract string formatValue(object o);
+    protected abstract object parseValue(string o);
+
+    public object DoFormat(object obj) {
+      Array a = (Array)obj;
+      StringBuilder sb = new StringBuilder();
+      sb.Append(a.Rank);
+      for (int i = 0; i < a.Rank; i++) {
+        sb.Append(Separator);
+        sb.Append(a.GetLength(i));
+      }
+      foreach (object o in a) {
+        sb.Append(Separator);
+        sb.Append(formatValue(o));
+      }
+      return sb.ToString();
+    }
+
+    public object Parse(object o) {
+      IEnumerator values =
+        ((string)o)
+        .Split(new[] { Separator },
+        StringSplitOptions.RemoveEmptyEntries).GetEnumerator();
+      values.MoveNext();
+      int rank = int.Parse((string)values.Current);
+      int[] lengths = new int[rank];
+      for (int i = 0; i < rank; i++) {
+        values.MoveNext();
+        lengths[i] = int.Parse((string)values.Current);
+      }
+      Array a = Array.CreateInstance(this.Type.GetElementType(), lengths);
+      int[] positions = new int[rank];
+      while (values.MoveNext()) {
+        a.SetValue(parseValue((string)values.Current), positions);
+        positions[0] += 1;
+        for (int i = 0; i < rank - 1; i++) {
+          if (positions[i] >= lengths[i]) {
+            positions[i] = 0;
+            positions[i + 1] += 1;
+          } else {
+            break;
+          }
+        }
+      }
+      return a;
+    }
+  }
+  
+}
Index: /branches/New Persistence Exploration/Persistence/Persistence/Default/Xml/Compact/NumberEnumeration2XmlFormatter.cs
===================================================================
--- /branches/New Persistence Exploration/Persistence/Persistence/Default/Xml/Compact/NumberEnumeration2XmlFormatter.cs	(revision 1361)
+++ /branches/New Persistence Exploration/Persistence/Persistence/Default/Xml/Compact/NumberEnumeration2XmlFormatter.cs	(revision 1361)
@@ -0,0 +1,37 @@
+﻿using System.Collections;
+using System.Text;
+using HeuristicLab.Persistence.Interfaces;
+using System;
+
+namespace HeuristicLab.Persistence.Default.Xml.Compact {
+  
+  public abstract class NumberEnumeration2XmlFormatter : IFormatter {
+
+    public abstract Type Type { get; }
+    public IFormat Format { get { return XmlFormat.Instance; } }
+    protected virtual string Separator { get { return ";"; } }
+    protected abstract void Add(IEnumerable enumeration, object o);
+    protected abstract object Instantiate();
+    protected abstract string formatValue(object o);
+    protected abstract object parseValue(string o);
+
+    public object DoFormat(object o) {
+      StringBuilder sb = new StringBuilder();
+      foreach (var value in (IEnumerable)o) {
+        sb.Append(formatValue(value));
+        sb.Append(Separator);
+      }
+      return sb.ToString();
+    }
+
+    public object Parse(object o) {
+      IEnumerable enumeration = (IEnumerable)Instantiate();
+      string[] values = ((string)o).Split(new[] { Separator }, StringSplitOptions.RemoveEmptyEntries);
+      foreach (var value in values) {
+        Add(enumeration, parseValue(value));
+      }
+      return enumeration;
+    }
+  }
+  
+}
Index: /branches/New Persistence Exploration/Persistence/Persistence/Default/Xml/Primitive/Boolean2XmlFormatter.cs
===================================================================
--- /branches/New Persistence Exploration/Persistence/Persistence/Default/Xml/Primitive/Boolean2XmlFormatter.cs	(revision 1361)
+++ /branches/New Persistence Exploration/Persistence/Persistence/Default/Xml/Primitive/Boolean2XmlFormatter.cs	(revision 1361)
@@ -0,0 +1,21 @@
+﻿using System;
+using HeuristicLab.Persistence.Interfaces;
+
+namespace HeuristicLab.Persistence.Default.Xml.Primitive {
+  
+  public class Boolean2XmlFormatter : IFormatter {    
+
+    public Type Type { get { return typeof(bool); } }
+    public IFormat Format { get { return XmlFormat.Instance; } }
+
+    public object DoFormat(object o) {
+      return ((bool)o).ToString();
+    }
+
+    public object Parse(object o) {
+      return bool.Parse((string)o);
+    }
+
+  }  
+
+}
Index: /branches/New Persistence Exploration/Persistence/Persistence/Default/Xml/Primitive/DateTime2XmlFormatter.cs
===================================================================
--- /branches/New Persistence Exploration/Persistence/Persistence/Default/Xml/Primitive/DateTime2XmlFormatter.cs	(revision 1361)
+++ /branches/New Persistence Exploration/Persistence/Persistence/Default/Xml/Primitive/DateTime2XmlFormatter.cs	(revision 1361)
@@ -0,0 +1,22 @@
+﻿using System;
+using HeuristicLab.Persistence.Interfaces;
+
+namespace HeuristicLab.Persistence.Default.Xml.Primitive {
+  
+  public class DateTime2XmlFormatter : IFormatter {    
+
+    public Type Type { get { return typeof(DateTime); } }
+    public IFormat Format { get { return XmlFormat.Instance; } }  
+
+    public object DoFormat(object o) {
+      return ((DateTime)o).Ticks.ToString();      
+    }
+
+    public object Parse(object o) {
+      return new DateTime(long.Parse((string)o));
+    }
+
+  }
+
+  
+}
Index: /branches/New Persistence Exploration/Persistence/Persistence/Default/Xml/Primitive/Double2XmlFormatter.cs
===================================================================
--- /branches/New Persistence Exploration/Persistence/Persistence/Default/Xml/Primitive/Double2XmlFormatter.cs	(revision 1361)
+++ /branches/New Persistence Exploration/Persistence/Persistence/Default/Xml/Primitive/Double2XmlFormatter.cs	(revision 1361)
@@ -0,0 +1,22 @@
+﻿using System;
+using System.Globalization;
+using HeuristicLab.Persistence.Interfaces;
+
+namespace HeuristicLab.Persistence.Default.Xml.Primitive {
+
+  public class Double2XmlFormatter : IFormatter {    
+
+    public Type Type { get { return typeof(double); } }
+    public IFormat Format { get { return XmlFormat.Instance; } }
+
+    public object DoFormat(object o) {
+      return ((double)o).ToString("r", CultureInfo.InvariantCulture);      
+    }
+
+    public object Parse(object o) {
+      return double.Parse((string)o, CultureInfo.InvariantCulture);
+    }
+
+  }
+  
+}
Index: /branches/New Persistence Exploration/Persistence/Persistence/Default/Xml/Primitive/Int2XmlFormatter.cs
===================================================================
--- /branches/New Persistence Exploration/Persistence/Persistence/Default/Xml/Primitive/Int2XmlFormatter.cs	(revision 1361)
+++ /branches/New Persistence Exploration/Persistence/Persistence/Default/Xml/Primitive/Int2XmlFormatter.cs	(revision 1361)
@@ -0,0 +1,21 @@
+﻿using System;
+using HeuristicLab.Persistence.Interfaces;
+
+namespace HeuristicLab.Persistence.Default.Xml.Primitive {
+
+  public class Int2XmlFormatter : IFormatter {
+
+    public Type Type { get { return typeof(int); } }
+    public IFormat Format { get { return XmlFormat.Instance; } }
+
+    public object DoFormat(object o) {
+      return ((int)o).ToString();
+    }
+
+    public object Parse(object o) {
+      return int.Parse((string)o);
+    }
+
+  }
+  
+}
Index: /branches/New Persistence Exploration/Persistence/Persistence/Default/Xml/Primitive/Sting2XmlFormatter.cs
===================================================================
--- /branches/New Persistence Exploration/Persistence/Persistence/Default/Xml/Primitive/Sting2XmlFormatter.cs	(revision 1361)
+++ /branches/New Persistence Exploration/Persistence/Persistence/Default/Xml/Primitive/Sting2XmlFormatter.cs	(revision 1361)
@@ -0,0 +1,28 @@
+﻿using System;
+using System.Text;
+using HeuristicLab.Persistence.Interfaces;
+
+namespace HeuristicLab.Persistence.Default.Xml.Primitive {
+
+  public class String2XmlFormatter : IFormatter {
+
+    public Type Type { get { return typeof(string); } }
+    public IFormat Format { get { return XmlFormat.Instance;  } }
+
+    public object DoFormat(object o) {      
+      return "<![CDATA[" +
+        ((string)o).Replace("]]>", "]]]]><![CDATA[>") +
+        "]]>";
+    }
+
+    public object Parse(object o) {
+      StringBuilder sb = new StringBuilder();
+      foreach (string s in ((string)o).Split(
+        new[] { "<![CDATA[", "]]>" },
+        StringSplitOptions.RemoveEmptyEntries)) {
+        sb.Append(s);
+      }
+      return sb.ToString();
+    }
+  }  
+}
Index: /branches/New Persistence Exploration/Persistence/Persistence/Default/Xml/XmlFormat.cs
===================================================================
--- /branches/New Persistence Exploration/Persistence/Persistence/Default/Xml/XmlFormat.cs	(revision 1361)
+++ /branches/New Persistence Exploration/Persistence/Persistence/Default/Xml/XmlFormat.cs	(revision 1361)
@@ -0,0 +1,10 @@
+﻿using HeuristicLab.Persistence.Interfaces;
+
+namespace HeuristicLab.Persistence.Default.Xml {
+
+  public class XmlFormat : IFormat {
+    public string Name { get { return "XML"; } }
+    public static readonly XmlFormat Instance = new XmlFormat();
+  }
+
+}
Index: /branches/New Persistence Exploration/Persistence/Persistence/Default/Xml/XmlGenerator.cs
===================================================================
--- /branches/New Persistence Exploration/Persistence/Persistence/Default/Xml/XmlGenerator.cs	(revision 1361)
+++ /branches/New Persistence Exploration/Persistence/Persistence/Default/Xml/XmlGenerator.cs	(revision 1361)
@@ -0,0 +1,119 @@
+﻿using System.Collections.Generic;
+using System;
+using System.Text;
+using HeuristicLab.Persistence.Interfaces;
+
+namespace HeuristicLab.Persistence.Default.Xml {
+
+  struct XmlStrings {
+    public const string PRIMITIVE = "PRIMITVE";
+    public const string COMPOSITE = "COMPOSITE";
+    public const string REFERENCE = "REFERENCE";
+    public const string NULL = "NULL";
+    public const string TYPECACHE = "TYPCACHE";
+    public const string TYPE = "TYPE";
+  }
+  
+  public class XmlGenerator {
+    
+    delegate string Formatter(ISerializationToken token);
+
+    private readonly Dictionary<Type, Formatter> formatters;
+    private int depth;
+
+    public XmlGenerator() {
+      formatters = new Dictionary<Type, Formatter>{
+                       {typeof (BeginToken), FormatBegin},
+                       {typeof (EndToken), FormatEnd},
+                       {typeof (PrimitiveToken), FormatPrimitive},
+                       {typeof (ReferenceToken), FormatReference},
+                       {typeof (NullReferenceToken), FormatNullReference}
+                     };
+      depth = 0;
+    }
+
+    private enum NodeType { Start, End, Inline } ;
+
+    private static string FormatNode(string name, Dictionary<string, object> attributes, NodeType type) {
+      StringBuilder sb = new StringBuilder();
+      sb.Append('<');
+      if (type == NodeType.End)
+        sb.Append('/');
+      sb.Append(name);      
+      foreach (var attribute in attributes) {
+        if (attribute.Value != null && !string.IsNullOrEmpty(attribute.Value.ToString())) {
+          sb.Append(' ');
+          sb.Append(attribute.Key);
+          sb.Append("=\"");
+          sb.Append(attribute.Value);
+          sb.Append('"');
+        }
+      }
+      if (type == NodeType.Inline)
+        sb.Append('/');
+      sb.Append(">");
+      return sb.ToString();      
+    }
+
+    public string Format(ISerializationToken token) {
+      return formatters[token.GetType()](token);
+    }
+
+    private string Prefix {
+      get { return new string(' ', depth * 2); }
+    }
+
+    private string FormatBegin(ISerializationToken token) {      
+      BeginToken beginToken = (BeginToken)token;
+      var attributes = new Dictionary<string, object> {
+        {"name", beginToken.Name},
+        {"typeId", beginToken.TypeId},
+        {"id", beginToken.Id}};
+      string result = Prefix +
+                      FormatNode(XmlStrings.COMPOSITE, attributes, NodeType.Start) + "\n";
+      depth += 1;
+      return result;
+    }
+
+    private string FormatEnd(ISerializationToken token) {      
+      depth -= 1;
+      return Prefix + "</" + XmlStrings.COMPOSITE + ">\n";
+    }
+
+    private string FormatPrimitive(ISerializationToken token) {
+      PrimitiveToken dataToken = (PrimitiveToken)token;
+      var attributes =
+        new Dictionary<string, object> {
+            {"typeId", dataToken.TypeId},
+            {"name", dataToken.Name},
+            {"id", dataToken.Id}};
+      return Prefix +
+        FormatNode(XmlStrings.PRIMITIVE, attributes, NodeType.Start) +
+        dataToken.SerialData + "</" + XmlStrings.PRIMITIVE + ">\n";      
+    }
+
+    private string FormatReference(ISerializationToken token) {
+      ReferenceToken refToken = (ReferenceToken) token;
+      var attributes = new Dictionary<string, object> {
+        {"ref", refToken.Id},
+        {"name", refToken.Name}};                                       
+      return Prefix + FormatNode(XmlStrings.REFERENCE, attributes, NodeType.Inline) + "\n";  
+    }
+
+    private string FormatNullReference(ISerializationToken token) {
+      NullReferenceToken nullRefToken = (NullReferenceToken)token;
+      var attributes = new Dictionary<string, object>{
+        {"name", nullRefToken.Name}};      
+      return Prefix + FormatNode(XmlStrings.NULL, attributes, NodeType.Inline) + "\n";
+    }
+
+    public IEnumerable<string> Format(Dictionary<string, int> typeCache) {
+      yield return "<" + XmlStrings.TYPECACHE + ">";
+      foreach ( var pair in typeCache )
+        yield return FormatNode(XmlStrings.TYPE,
+                                new Dictionary<string, object> {{"id", pair.Value}, {"name", pair.Key}},
+                                NodeType.Inline);        
+      yield return "</" + XmlStrings.TYPECACHE + ">";
+    }
+  }
+}
Index: /branches/New Persistence Exploration/Persistence/Persistence/Default/Xml/XmlParser.cs
===================================================================
--- /branches/New Persistence Exploration/Persistence/Persistence/Default/Xml/XmlParser.cs	(revision 1361)
+++ /branches/New Persistence Exploration/Persistence/Persistence/Default/Xml/XmlParser.cs	(revision 1361)
@@ -0,0 +1,105 @@
+﻿using System.Xml;
+using System.Collections.Generic;
+using System;
+using System.Collections;
+using System.IO;
+using HeuristicLab.Persistence.Interfaces;
+
+namespace HeuristicLab.Persistence.Default.Xml {
+
+
+  public class XmlParser : IEnumerable<ISerializationToken> {
+
+    private readonly XmlReader reader;
+    private delegate IEnumerator<ISerializationToken> Handler();
+    private readonly Dictionary<string, Handler> handlers;
+
+    public XmlParser(TextReader input) {
+      XmlReaderSettings settings = new XmlReaderSettings {
+                                       ConformanceLevel = ConformanceLevel.Document,
+                                       IgnoreWhitespace = true,
+                                       IgnoreComments = true
+                                     };
+      reader = XmlReader.Create(input, settings);
+      handlers = new Dictionary<string, Handler> {
+                     {XmlStrings.PRIMITIVE, ParsePrimitive},
+                     {XmlStrings.COMPOSITE, ParseComposite},
+                     {XmlStrings.REFERENCE, ParseReference},
+                     {XmlStrings.NULL, ParseNull}
+                   };
+    }
+
+    public IEnumerator<ISerializationToken> GetEnumerator() {
+      while (reader.Read()) {
+        if (!reader.IsStartElement()) {
+          break;
+        }
+        IEnumerator<ISerializationToken> iterator;
+        try {
+          iterator = handlers[reader.Name].Invoke();
+        }
+        catch (KeyNotFoundException) {
+          throw new InvalidOperationException(String.Format(
+            "No handler for XML tag \"{0}\" installed",
+            reader.Name));
+        }
+        while (iterator.MoveNext()) {
+          yield return iterator.Current;
+        }
+      }
+    }
+
+    private IEnumerator<ISerializationToken> ParsePrimitive() {
+      int? id = null;
+      string idString = reader.GetAttribute("id");
+      if (idString != null)
+        id = int.Parse(idString);
+      yield return new PrimitiveToken(
+        reader.GetAttribute("name"),
+        int.Parse(reader.GetAttribute("typeId")),
+        reader.ReadString(),
+        id);
+    }
+
+    private IEnumerator<ISerializationToken> ParseComposite() {
+      string name = reader.GetAttribute("name");            
+      string idString = reader.GetAttribute("id");
+      int? id = null;
+      int? typeId = null;
+      if (idString != null)
+        id = int.Parse(idString);
+        typeId = int.Parse(reader.GetAttribute("typeId"));
+      yield return new BeginToken(name, typeId, id);
+      IEnumerator<ISerializationToken> iterator = GetEnumerator();
+      while (iterator.MoveNext())
+        yield return iterator.Current;
+      yield return new EndToken(name, typeId, id);
+    }
+
+    private IEnumerator<ISerializationToken> ParseReference() {
+      yield return new ReferenceToken(
+        reader.GetAttribute("name"),
+        int.Parse(reader.GetAttribute("ref")));
+    }
+
+    private IEnumerator<ISerializationToken> ParseNull() {
+      yield return new NullReferenceToken(reader.GetAttribute("name"));
+    }
+
+    IEnumerator IEnumerable.GetEnumerator() {
+      return GetEnumerator();
+    }
+
+    public static Dictionary<string, int> ParseTypeCache(TextReader reader) {
+      Dictionary<string, int> typeCache = new Dictionary<string, int>();
+      XmlReader xmlReader = XmlReader.Create(reader);
+      while ( xmlReader.Read() ) {
+        if (xmlReader.Name == XmlStrings.TYPE) {          
+          typeCache.Add(xmlReader.GetAttribute("name")
+          , int.Parse(xmlReader.GetAttribute("id")));
+        }
+      }
+      return typeCache;
+    }
+  }  
+}
Index: anches/New Persistence Exploration/Persistence/Persistence/Default/XmlFormatter.cs
===================================================================
--- /branches/New Persistence Exploration/Persistence/Persistence/Default/XmlFormatter.cs	(revision 1360)
+++ 	(revision )
@@ -1,122 +1,0 @@
-﻿using System.Collections.Generic;
-using System;
-using System.Text;
-using HeuristicLab.Persistence.Interfaces;
-
-namespace HeuristicLab.Persistence {
-
-  struct XmlStrings {
-    public const string PRIMITIVE = "PRIMITVE";
-    public const string COMPOSITE = "COMPOSITE";
-    public const string REFERENCE = "REFERENCE";
-    public const string NULL = "NULL";
-    public const string TYPECACHE = "TYPCACHE";
-    public const string TYPE = "TYPE";
-  }
-  
-  public class XmlFormatter {
-    
-    delegate string Formatter(ISerializationToken token);
-
-    private readonly Dictionary<Type, Formatter> formatters;
-    private int depth;
-
-    public XmlFormatter() {
-      formatters = new Dictionary<Type, Formatter>{
-                       {typeof (BeginToken), FormatBegin},
-                       {typeof (EndToken), FormatEnd},
-                       {typeof (PrimitiveToken), FormatPrimitive},
-                       {typeof (ReferenceToken), FormatReference},
-                       {typeof (NullReferenceToken), FormatNullReference}
-                     };
-      depth = 0;
-    }
-
-    private enum NodeType { Start, End, Inline } ;
-
-    private static string FormatNode(string name, Dictionary<string, string> attributes, NodeType type) {
-      StringBuilder sb = new StringBuilder();
-      sb.Append('<');
-      if (type == NodeType.End)
-        sb.Append('/');
-      sb.Append(name);      
-      foreach (var attribute in attributes) {
-        sb.Append(' ');
-        sb.Append(attribute.Key);
-        sb.Append("=\"");
-        sb.Append(attribute.Value);
-        sb.Append('"');
-      }
-      if (type == NodeType.Inline)
-        sb.Append('/');
-      sb.Append(">");
-      return sb.ToString();      
-    }
-
-    public string Format(ISerializationToken token) {
-      return formatters[token.GetType()](token);
-    }
-
-    private string Prefix {
-      get { return new string(' ', depth * 2); }
-    }
-
-    private string FormatBegin(ISerializationToken token) {      
-      BeginToken beginToken = (BeginToken)token;
-      var attributes = new Dictionary<string, string> {{"name", beginToken.Name}};
-      if ( beginToken.TypeId != null )
-        attributes.Add("typeId", beginToken.TypeId.ToString());
-      if ( beginToken.Id != null ) 
-        attributes.Add("id", beginToken.Id.ToString());                                           
-      string result = Prefix +
-                      FormatNode(XmlStrings.COMPOSITE, attributes, NodeType.Start) + "\n";
-      depth += 1;
-      return result;
-    }
-
-    private string FormatEnd(ISerializationToken token) {      
-      depth -= 1;
-      return Prefix + "</" + XmlStrings.COMPOSITE + ">\n";
-    }
-
-    private string FormatPrimitive(ISerializationToken token) {
-      PrimitiveToken dataToken = (PrimitiveToken)token;
-      Dictionary<string, string> attributes =
-        new Dictionary<string, string> {
-            {"typeId", dataToken.TypeId.ToString()}};
-      if ( !string.IsNullOrEmpty(dataToken.Name) )
-        attributes.Add("name", dataToken.Name);
-      if ( dataToken.Id != null )
-        attributes.Add("id", dataToken.Id.ToString());
-      return Prefix +
-        FormatNode(XmlStrings.PRIMITIVE, attributes, NodeType.Start) +
-        dataToken.SerialData + "</" + XmlStrings.PRIMITIVE + ">\n";      
-    }
-
-    private string FormatReference(ISerializationToken token) {
-      ReferenceToken refToken = (ReferenceToken) token;
-      Dictionary<string, string> attributes =
-        new Dictionary<string, string> {{"ref", refToken.Id.ToString()}};
-      if ( refToken.Name != null )
-        attributes.Add("name", refToken.Name);
-      return Prefix + FormatNode(XmlStrings.REFERENCE, attributes, NodeType.Inline) + "\n";  
-    }
-
-    private string FormatNullReference(ISerializationToken token) {
-      NullReferenceToken nullRefToken = (NullReferenceToken)token;
-      Dictionary<string, string> attributes = new Dictionary<string, string>();
-      if (nullRefToken.Name != null)
-        attributes.Add("name", nullRefToken.Name);
-      return Prefix + FormatNode(XmlStrings.NULL, attributes, NodeType.Inline) + "\n";
-    }
-
-    public IEnumerable<string> Format(Dictionary<string, int> typeCache) {
-      yield return "<" + XmlStrings.TYPECACHE + ">";
-      foreach ( var pair in typeCache ) {
-        yield return String.Format("  <" + XmlStrings.TYPE + " id=\"{0}\" name=\"{1}\"/>",
-                                   pair.Value, pair.Key);        
-      }
-      yield return "</" + XmlStrings.TYPECACHE + ">";
-    }
-  }
-}
Index: anches/New Persistence Exploration/Persistence/Persistence/Default/XmlParser.cs
===================================================================
--- /branches/New Persistence Exploration/Persistence/Persistence/Default/XmlParser.cs	(revision 1360)
+++ 	(revision )
@@ -1,98 +1,0 @@
-﻿using System.Xml;
-using System.Collections.Generic;
-using System;
-using System.Collections;
-using System.IO;
-using HeuristicLab.Persistence.Interfaces;
-
-namespace HeuristicLab.Persistence {
-
-
-  public class XmlParser : IEnumerable<ISerializationToken> {
-
-    private readonly XmlReader reader;
-    private delegate IEnumerator<ISerializationToken> Handler();
-    private readonly Dictionary<string, Handler> handlers;
-
-    public XmlParser(TextReader input) {
-      XmlReaderSettings settings = new XmlReaderSettings {
-                                       ConformanceLevel = ConformanceLevel.Document,
-                                       IgnoreWhitespace = true,
-                                       IgnoreComments = true
-                                     };
-      reader = XmlReader.Create(input, settings);
-      handlers = new Dictionary<string, Handler> {
-                     {XmlStrings.PRIMITIVE, ParsePrimitive},
-                     {XmlStrings.COMPOSITE, ParseComposite},
-                     {XmlStrings.REFERENCE, ParseReference},
-                     {XmlStrings.NULL, ParseNull}
-                   };
-    }
-    public IEnumerator<ISerializationToken> GetEnumerator() {
-      while (reader.Read()) {
-        if (!reader.IsStartElement()) {
-          break;
-        }
-        IEnumerator<ISerializationToken> iterator;
-        try {
-          iterator = handlers[reader.Name].Invoke();
-        }
-        catch (KeyNotFoundException) {
-          throw new InvalidOperationException(String.Format(
-            "No handler for XML tag \"{0}\" installed",
-            reader.Name));
-        }
-        while (iterator.MoveNext()) {
-          yield return iterator.Current;
-        }
-      }
-    }
-    private IEnumerator<ISerializationToken> ParsePrimitive() {
-      int? id = null;
-      string idString = reader.GetAttribute("id");
-      if (idString != null)
-        id = int.Parse(idString);
-      yield return new PrimitiveToken(
-        reader.GetAttribute("name"),
-        int.Parse(reader.GetAttribute("typeId")),
-        reader.ReadString(),
-        id);
-    }
-    private IEnumerator<ISerializationToken> ParseComposite() {
-      string name = reader.GetAttribute("name");            
-      string idString = reader.GetAttribute("id");
-      int? id = null;
-      int? typeId = null;
-      if (idString != null)
-        id = int.Parse(idString);
-        typeId = int.Parse(reader.GetAttribute("typeId"));
-      yield return new BeginToken(name, typeId, id);
-      IEnumerator<ISerializationToken> iterator = GetEnumerator();
-      while (iterator.MoveNext())
-        yield return iterator.Current;
-      yield return new EndToken(name, typeId, id);
-    }
-    private IEnumerator<ISerializationToken> ParseReference() {
-      yield return new ReferenceToken(
-        reader.GetAttribute("name"),
-        int.Parse(reader.GetAttribute("ref")));
-    }
-    private IEnumerator<ISerializationToken> ParseNull() {
-      yield return new NullReferenceToken(reader.GetAttribute("name"));
-    }
-    IEnumerator IEnumerable.GetEnumerator() {
-      return GetEnumerator();
-    }
-    public static Dictionary<string, int> ParseTypeCache(TextReader reader) {
-      Dictionary<string, int> typeCache = new Dictionary<string, int>();
-      XmlReader xmlReader = XmlReader.Create(reader);
-      while ( xmlReader.Read() ) {
-        if (xmlReader.Name == XmlStrings.TYPE) {          
-          typeCache.Add(xmlReader.GetAttribute("name")
-          , int.Parse(xmlReader.GetAttribute("id")));
-        }
-      }
-      return typeCache;
-    }
-  }  
-}
Index: /branches/New Persistence Exploration/Persistence/Persistence/HeuristicLab.Persistence.csproj
===================================================================
--- /branches/New Persistence Exploration/Persistence/Persistence/HeuristicLab.Persistence.csproj	(revision 1360)
+++ /branches/New Persistence Exploration/Persistence/Persistence/HeuristicLab.Persistence.csproj	(revision 1361)
@@ -55,7 +55,21 @@
   </ItemGroup>
   <ItemGroup>
-    <Compile Include="Default\NumberArrayFormatters.cs" />
+    <Compile Include="Default\Decomposers\EnumerableDecomposer.cs" />
+    <Compile Include="Default\Decomposers\ArrayDecomposer.cs" />
+    <Compile Include="Default\Decomposers\KeyValuePairDecomposer.cs" />
+    <Compile Include="Default\Decomposers\DictionaryDecomposer.cs" />
+    <Compile Include="Default\Xml\Compact\IntArray2XmlFormatters.cs" />
+    <Compile Include="Default\Xml\Compact\DoubleArray2XmlFormatters.cs" />
+    <Compile Include="Default\Xml\Compact\DoubleList2XmlFormatter.cs" />
+    <Compile Include="Default\Xml\Compact\NumberEnumeration2XmlFormatter.cs" />
+    <Compile Include="Default\Xml\Compact\NumberArray2XmlFormatters.cs" />
     <Compile Include="Core\DataMemberAccessor.cs" />
-    <Compile Include="Default\EnumerableFormatters.cs" />
+    <Compile Include="Default\Xml\Compact\IntList2XmlFormatter.cs" />
+    <Compile Include="Default\Xml\Primitive\Sting2XmlFormatter.cs" />
+    <Compile Include="Default\Xml\Primitive\Int2XmlFormatter.cs" />
+    <Compile Include="Default\Xml\Primitive\Double2XmlFormatter.cs" />
+    <Compile Include="Default\Xml\Primitive\Boolean2XmlFormatter.cs" />
+    <Compile Include="Default\Xml\Primitive\DateTime2XmlFormatter.cs" />
+    <Compile Include="Default\Xml\XmlFormat.cs" />
     <Compile Include="HeuristicLabPersistencePlugin.cs" />
     <Compile Include="Core\DeSerializer.cs" />
@@ -65,11 +79,9 @@
     <Compile Include="Properties\AssemblyInfo.cs" />
     <Compile Include="Core\Serializer.cs" />
-    <Compile Include="Default\Decomposers.cs" />
-    <Compile Include="Default\PrimitiveFormatters.cs" />
     <Compile Include="Interfaces\Tokens.cs" />
     <Compile Include="Util.cs" />
     <Compile Include="Core\StorableAttribute.cs" />
-    <Compile Include="Default\XmlFormatter.cs" />
-    <Compile Include="Default\XmlParser.cs" />
+    <Compile Include="Default\Xml\XmlGenerator.cs" />
+    <Compile Include="Default\Xml\XmlParser.cs" />
   </ItemGroup>
   <PropertyGroup>
Index: /branches/New Persistence Exploration/Persistence/Test/NewSerializationTest.cs
===================================================================
--- /branches/New Persistence Exploration/Persistence/Test/NewSerializationTest.cs	(revision 1360)
+++ /branches/New Persistence Exploration/Persistence/Test/NewSerializationTest.cs	(revision 1361)
@@ -4,4 +4,5 @@
 using System.IO;
 using HeuristicLab.Persistence.Core;
+using HeuristicLab.Persistence.Default.Xml;
 using HeuristicLab.Persistence.Interfaces;
 
@@ -154,8 +155,8 @@
       r.dict.Add("three", 3);
       Serializer s = new Serializer(r, ConfigurationService.Instance.GetDefaultConfig(XmlFormat.Instance));        
-      Persistence.XmlFormatter xmlFormatter = new XmlFormatter();
+      XmlGenerator xmlGenerator = new XmlGenerator();
       StreamWriter writer = new StreamWriter("test.xml");
       foreach (ISerializationToken token in s) {
-        string line = xmlFormatter.Format(token);
+        string line = xmlGenerator.Format(token);
         writer.Write(line);
         Console.Out.Write(line);
@@ -163,5 +164,5 @@
       writer.Close();
       writer = new StreamWriter("test-types.xml");
-      foreach (string line in xmlFormatter.Format(s.TypeCache)) {
+      foreach (string line in xmlGenerator.Format(s.TypeCache)) {
         writer.WriteLine(line);
         Console.Out.WriteLine(line);
@@ -181,8 +182,8 @@
       Serializer s = new Serializer(m,
         ConfigurationService.Instance.GetDefaultConfig(XmlFormat.Instance));
-      Persistence.XmlFormatter xmlFormatter = new XmlFormatter();
+      XmlGenerator xmlGenerator = new XmlGenerator();
       StreamWriter writer = new StreamWriter("test2.xml");
       foreach (ISerializationToken token in s) {
-        string line = xmlFormatter.Format(token);
+        string line = xmlGenerator.Format(token);
         writer.Write(line);
         Console.Out.Write(line);
