This has been broken for a fair while now. There are heaps of working code formatters available on the web.
e.g.
var doc = DOMDocument.fromXMLString(r.body);
var responseNode = doc.getElementsByTagName("response")[0];
var success = responseNode.getAttribute("success");
Thanks
Darren