using System;
using System.Collections.Generic;
using Newtonsoft.Json;
using System.Xml;
public class Program
{
public static void Main()
var xml = @"<myRoot>
<item>
<a>aaaa</a>
</item>
<a>bbbb</a>
<a>cccc</a>
</myRoot>";
XmlDocument xmldocument = new XmlDocument();
xmldocument.LoadXml(xml);
var json = JsonConvert.SerializeXmlNode(xmldocument,Newtonsoft.Json.Formatting.Indented,true);
Console.WriteLine(json);
//Output : {"Items":{"Item":[{"Name":"name","Detail":"detail"}]}}
}