Something to convert in XML?

I'm facing a problem now. I need to convert some datas (in function node) in XML to connect an API... but the current XML syntax is not accepted in Node Red function Node:

For example my object is named : WifiAccessPoints
But on the other side, the API is waiting for : access-point

What is the right solution to rename WifiAccessPoints in access-point without errors in my function node?


This page might be of use

Thanks... but I did not see any relative answer... as here, the problem is to write a composed name with a - in the middle, which I don't know how it is supported in my function node or in javascript (I don't know javascript)...

use key notation eg

objectName["property"] // person["age"]

I'm sorry but I still can't see where is the relation....

Can someone please explain me how to replace wifiAccessPoints with access-point in answer.wifiAccessPoints and in answer.wifiAccessPoints.push, in the code below??

let i;
answer.wifiAccessPoints = []
    if (answer.flag === "V") {
        let wifiAccessPointsStrings = elements[5].split("&")
        let j;
        for (j = 0; j < wifiAccessPointsStrings.length; j++) {
            let baseElements = wifiAccessPointsStrings[j].split("|")
            answer.wifiAccessPoints.push({ ssid: baseElements[0], macAddress: baseElements[1], signalStrength: baseElements[2] })  
      answer.baseCountwifiAccessPoints = answer.wifiAccessPoints.length
msg["test-123"].push=({ ssid: "ssid", macAddress:"the mac address" });
return msg;

You saved my day !!! Thanks...