Fix bugs in makeXml().