You can pass the result directly into the ogscript.parseXML function - it will take a String, a URL, or a file path:
////////// THIS WOULD ACTUALLY BE THE RESPONSE FROM YOUR HTTP POST
var resp = '<?xml version="1.0" encoding="UTF-8"?><api_response><version>6</version><timestamp>2019-05-01 20:39:27</timestamp><success>1</success><token>qau14rbel049tql9d7pvi00ri6</token></api_response>';
//////////
var doc = ogscript.parseXML(resp);
var nodes = doc.getElementsByTagName('token');
if (nodes != null && nodes.getLength() > 0)
{
ogscript.debug("TOKEN: " + nodes.item(0).getTextContent());
}
#DashBoard