 +     * @return  string
 +     */
 +    protected function encode($value) {
-+      if (!($encoded= create(new XmlRpcEncoder())->encode($value)) instanceof Node) {
-+        $this->fail('Could not encode '.xp::stringOf($value));
-+      }
-+      return $encoded->getSource(INDENT_NONE);
++      return create(new XmlRpcEncoder())->encode($value)->getSource(INDENT_NONE);
++    }
++    
++    /**
++     * Normalizes expected XML and returns whether that is equal to the 
++     * actual XML.
++     *
++     * @param   string expected
++     * @param   string actual
++     * @throws  unittest.AssertionFailedError
++     */
++    protected function assertXmlEquals($expected, $actual) {
++      $this->assertEquals(preg_replace('#>[\s\r\n]+<#', '><', trim($expected)), $actual);
 +    }
 +  
 +    /**

+      $vo->setAge(30);
+      $vo->setNew(TRUE);
+      
+      $this->assertEquals(preg_replace('#>[\s\r\n]+<#', '><', trim('
+        <value>
+          <struct>
+            <member>

+            </member>
+          </struct>
+        </value>
+        ', 
+        $this->encode($vo)
+      );
+    }
