Can we convert object into XML inside Javascipt

I"m working in a scenario where I'm getting xml object from the httpClient's getResponse().content. And I need to deal with values that are present in the response. But its not allowing me to extract those values in javascript.

Note: I cannot use XML-to-JSON like policies in my use-case I can only work with javascript. Because I'm calling hitting multiple HTTP requests based on the ids present in the input.

var url = properties.endpoint + '?billingId=' + billingIds[index];
var myRequest = new Request(url, "GET");

context.setVariable("myRequesttest", myRequest);
var exchange = httpClient.send(myRequest);
exchange.waitForComplete();

if (exchange.isSuccess()) {
    var responseObj = exchange.getResponse().content;
    context.setVariable("response.content", responseObj);
    context.setVariable("myResponse", responseObj);
} else if (exchange.isError()) {
     context.setVariable("myResponseError", exchange.getError());
}
0 1 47
1 REPLY 1

I answered this question here.