updated the example to include to_xml