function testSerialize()
    {
        $r = new Hypercharge\RiskParams(array('session_id' => '123'));
        $root = Hypercharge\XmlSerializer::createDocument('test');
        Hypercharge\XmlSerializer::_toXml($r, $root);
        $str = $root->ownerDocument->saveXML();
        $this->assertEqual('<?xml version="1.0" encoding="UTF-8"?>
<test>
  <session_id>123</session_id>
</test>
', $str);
    }
    function testSerialize()
    {
        $a = new Hypercharge\Address($this->address());
        Hypercharge\XmlSerializer::$sort = false;
        $root = Hypercharge\XmlSerializer::createDocument('r');
        Hypercharge\XmlSerializer::_toXml($a, $root);
        $str = $root->ownerDocument->saveXML();
        $this->assertEqual($str, '<?xml version="1.0" encoding="UTF-8"?>
<r>
  <first_name>Hans</first_name>
  <last_name>Hübner</last_name>
  <address1>Kuhrfürstenstr. 124</address1>
  <address2></address2>
  <zip_code>10578</zip_code>
  <city>Berlin</city>
  <state></state>
  <country>DE</country>
</r>
');
    }