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

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

+     * @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()
+        ));
+      }
+    }
+    
+    /**
