 ===================================================================
 --- facade/DataSetFacade.class.php	(revision 0)
 +++ facade/DataSetFacade.class.php	(revision 0)
-@@ -0,0 +1,142 @@
+@@ -0,0 +1,149 @@
 +<?php
 +/* This class is part of the XP framework
 + *

+     * @param   rdbms.DataSet entity
+     * @return  xml.Node
+     */
+    protected function marshalEntity(Peer $peer, DataSet $entity) {
+      $e= new Node('entity');
+
+      // Primary Key
+      $id= '';
+      foreach ($peer->primary as $field) {
+        $id= '&'.$field.'='.$entity->{$field};
+      }
+      $e->setAttribute('id', substr($id, 1));
+

+     * @return  rdbms.Peer
+     */
+    protected function getPeer() {
+      try {
+        return XPClass::forName($this->getClass()->getAnnotation('facade', 'datasource'))->getMethod('getPeer')->invoke(NULL);
+      } catch (ElementNotFoundException $e) {
+        throw new HttpScriptletException(sprintf(
+          'Class %s does not have a facade.datasource annotation',
+          $this->getClassName()
+        ));
+      }
+    }
+    
+    /**
