Serializando una estructura
<?php
$usuario = array (
'name' => 'John Q. Public',
'email' => 'jqp@example.com',
'account' => array (
'type' => 'editor',
'scope' => 'global'
)
);
$wddx = wddx_packet_start('Propiedades de usuario');
wddx_add_vars($wddx, 'usuario');
$xml = wddx_packet_end($wddx);
echo $xml;
?>
Resultado
<wddxPacket version='1.0'> <header> <comment>Propiedades de usuario</comment> </header> <data> <struct> <var name='usuario'> <struct> <var name='name'> <string>John Q. Public</string> </var> <var name='email'> <string>jqp@example.com</string> </var> <var name='account'> <struct> <var name='type'> <string>editor</string> </var> <var name='scope'> <string>global</string> </var> </struct> </var> </struct> </var> </struct> </data> </wddxPacket>