Updated printHashToXML code