Convert json to xml

Hello,

I would like to know the best way to convert json list of accounts to an xml repeating element like below-

“accounts”:[
“10”,
“9”,
“8”,
“7”,
“6”,
“5”,
“4”,
“3”,
“2”,
“1”
]

to
ns1:AccountIds
ns2:long10</ns2:long>
ns2:long9</ns2:long>
ns2:long8</ns2:long>
ns2:long7</ns2:long>
ns2:long6</ns2:long>
ns2:long5</ns2:long>
ns2:long4</ns2:long>
ns2:long3</ns2:long>
ns2:long2</ns2:long>
ns2:long1</ns2:long>
</ns1:AccountIds>