Fix incorrect error checking in save_xml(). Use qDebug() instead of cout.