using System;
using System.Linq;
using System.Xml;
using System.Xml.Linq;
using Newtonsoft.Json.Linq;
public class Program
{
public static void Main()
string jsonResult = @"
[
""car"": {
""features"": [
""code"": ""1""
},
""code"": ""2""
}
]
""code"": ""3""
]";
var ja = JArray.Parse(jsonResult);
var xml = new XDocument(
new XElement("cars",
ja.Select(c =>
new XElement("car",
new XElement("features",
c["car"]["features"].Select(f =>
new XElement("feature",
new XElement("code", (string)f["code"])
)
);
Console.WriteLine(xml.ToString());