Fix broken XML serialization

http://manage.dimagi.com/default.asp?112278