Fix bug in dict-to-XML routine