Index: /branches/New Persistence Exploration/Persistence/Persistence.sln
===================================================================
--- /branches/New Persistence Exploration/Persistence/Persistence.sln	(revision 1320)
+++ /branches/New Persistence Exploration/Persistence/Persistence.sln	(revision 1321)
@@ -4,5 +4,16 @@
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Persistence", "Persistence\Persistence.csproj", "{102BC7D3-0EF9-439C-8F6D-96FF0FDB8E1B}"
 EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PersistenceTest", "PersistenceTest\PersistenceTest.csproj", "{019D994A-9E37-4A4C-BBDD-914AB9A9634C}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{2F65B17D-22F7-4A48-8762-74BB8BE3E0E5}"
+	ProjectSection(SolutionItems) = preProject
+		LocalTestRun.testrunconfig = LocalTestRun.testrunconfig
+		Persistence.vsmdi = Persistence.vsmdi
+	EndProjectSection
+EndProject
 Global
+	GlobalSection(TestCaseManagementSettings) = postSolution
+		CategoryFile = Persistence.vsmdi
+	EndGlobalSection
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Any CPU = Debug|Any CPU
@@ -18,4 +29,10 @@
 		{102BC7D3-0EF9-439C-8F6D-96FF0FDB8E1B}.Release|Any CPU.Build.0 = Release|Any CPU
 		{102BC7D3-0EF9-439C-8F6D-96FF0FDB8E1B}.Release|x86.ActiveCfg = Release|Any CPU
+		{019D994A-9E37-4A4C-BBDD-914AB9A9634C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{019D994A-9E37-4A4C-BBDD-914AB9A9634C}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{019D994A-9E37-4A4C-BBDD-914AB9A9634C}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{019D994A-9E37-4A4C-BBDD-914AB9A9634C}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{019D994A-9E37-4A4C-BBDD-914AB9A9634C}.Release|Any CPU.Build.0 = Release|Any CPU
+		{019D994A-9E37-4A4C-BBDD-914AB9A9634C}.Release|x86.ActiveCfg = Release|Any CPU
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
Index: /branches/New Persistence Exploration/Persistence/Persistence/NewSerializationTest.cs
===================================================================
--- /branches/New Persistence Exploration/Persistence/Persistence/NewSerializationTest.cs	(revision 1320)
+++ /branches/New Persistence Exploration/Persistence/Persistence/NewSerializationTest.cs	(revision 1321)
@@ -78,4 +78,5 @@
       DeSerializer deSerializer = new DeSerializer();        
       object o = deSerializer.DeSerialize(parser);
+      Root t = StorableAttribute.Clone(r);
       Console.Out.WriteLine(Util.AutoFormat(o, true));      
     }
@@ -95,9 +96,10 @@
       DeSerializer deSerializer = new DeSerializer();
       object o = deSerializer.DeSerialize(parser);
-      Console.Out.WriteLine(Util.AutoFormat(o, true));
+      Manager n = StorableAttribute.Clone(m);
+      Console.Out.WriteLine(Util.AutoFormat(o, true));      
     }
 
     public static void Main() {
-      //Test1();
+      Test1();
       Test2();
       Console.In.ReadLine();
Index: /branches/New Persistence Exploration/Persistence/Persistence/StorableAttribute.cs
===================================================================
--- /branches/New Persistence Exploration/Persistence/Persistence/StorableAttribute.cs	(revision 1320)
+++ /branches/New Persistence Exploration/Persistence/Persistence/StorableAttribute.cs	(revision 1321)
@@ -3,4 +3,5 @@
 using System.Text;
 using System.Reflection;
+using System.Collections;
 
 namespace Persistence {
@@ -44,5 +45,64 @@
       }
       return autoStorableAccessors;
+    }
+
+    private static MethodInfo MemberwiseClone;
+
+    public static StorableAttribute() {
+      foreach (MethodInfo mi in typeof(object).GetMethods(BindingFlags.Instance | BindingFlags.NonPublic)) {
+        if (mi.Name == "MemberwiseClone") {
+          MemberwiseClone = mi;
+        }
+      }
+    }
+
+    public static T Clone<T>(T obj) {
+      List<ICompoundSerializer> compoundSerializers =
+        InterfaceInstantiatior.InstantiateAll<ICompoundSerializer>();
+      return Clone(obj, compoundSerializers);
+    }
+
+    public static T Clone<T>(T obj, IEnumerable<ICompoundSerializer> compoundSerializers) {
+      Dictionary<object, object> twins = new Dictionary<object, object>();      
+      return Clone(obj, twins, compoundSerializers);
     }    
+
+    public static T Clone<T>(T obj, Dictionary<object, object> twins,
+      IEnumerable<ICompoundSerializer> compoundSerializers) {
+      if (obj == null)
+        return default(T);
+      ValueType t = obj as ValueType;
+      if (t != null) {
+        return (T)obj;
+      }
+      if (twins.ContainsKey(obj))
+        return (T)twins[obj];
+      ICloneable c = obj as ICloneable;
+      if (c != null) {
+        T newClone = (T)c.Clone();      
+        twins[obj] = newClone;
+        return newClone;
+      }
+      T newInstance = (T)Activator.CreateInstance(obj.GetType());
+      twins[obj] = newInstance;
+      Dictionary<string, DataMemberAccessor> oldAccessors = GetAutostorableAccessors(obj);
+      if (oldAccessors.Count == 0) {        
+        foreach (ICompoundSerializer serializer in compoundSerializers) {
+          if ( serializer.CanSerialize(obj.GetType()) ) {
+            IEnumerable subObjects = serializer.Serialize(obj);
+            IEnumerable clonedSubObjects = Functional.Map(subObjects,
+              (x) => Clone(x, twins, compoundSerializers));
+            return (T)serializer.DeSerialize(clonedSubObjects, obj.GetType());
+          }
+        }
+        // TODO: fallback with memberwise clone?
+        throw new ApplicationException("cannot continue cloning, reached a dead end");
+      }
+      Dictionary<string, DataMemberAccessor> newAccessors = GetAutostorableAccessors(newInstance);
+      foreach (KeyValuePair<string, DataMemberAccessor> nameAccess in oldAccessors) {
+        newAccessors[nameAccess.Key].Set(Clone(nameAccess.Value.Get(), twins, compoundSerializers));
+      }
+      return newInstance;
+    }
   }
 
Index: /branches/New Persistence Exploration/Persistence/Persistence/Util.cs
===================================================================
--- /branches/New Persistence Exploration/Persistence/Persistence/Util.cs	(revision 1320)
+++ /branches/New Persistence Exploration/Persistence/Persistence/Util.cs	(revision 1321)
@@ -3,6 +3,18 @@
 using System.Text;
 using System.Reflection;
+using System.Collections;
 
 namespace Persistence {
+  public class Functional {
+
+    public delegate object Mapper(object x);
+
+    public static IEnumerable Map(IEnumerable enumeration, Mapper m) {
+      foreach (object t in enumeration) {
+        yield return m(t);
+      }
+    }
+
+  }
   public class InterfaceInstantiatior {
     public static List<T> InstantiateAll<T>() {
