Fixed invalid XML
More helpfull logging upon failure