XML to JSON object (renaming attributes)

I’m currently trying to convert an XML to a JSON Object in my Ionic app. I’ve tried the x2js plugin and also jsonix (but this one won’t work). The thing is, with x2js I can convert the xml to a json with the same attribute names of each field, but what i want is to rename them in the object.
let’s say the XML has an attribute “n” and i want it to be mapped as “name” in the object.
(I know this can be done with JAXB in a java project, for example)

I appreciate your support in advance.

cli packages:

@ionic/cli-utils  : 1.19.1
ionic (Ionic CLI) : 3.19.1

global packages:

cordova (Cordova CLI) : 8.1.2 (cordova-lib@8.1.1)

local packages:

@ionic/app-scripts : 3.1.11
Cordova Platforms  : android 6.4.0
Ionic Framework    : ionic-angular 3.9.2


Android SDK Tools : 26.1.1
Node              : v6.10.3
npm               : 5.6.0
OS                : Windows 10

In case anyone needs to know, this does the trick. You can first translate from xml to json with any plugin (such as x2js), then map the json to the existing classes with json2typescript :