public static void Main()
xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance""
xmlns:xsd=""http://www.w3.org/2001/XMLSchema""
xmlns:soapenv=""http://schemas.xmlsoap.org/soap/envelope/""
xmlns:soapenc=""http://schemas.xmlsoap.org/soap/encoding/"">
<CardCode>L10002</CardCode>
<AddressName>Bill To</AddressName>
<AddressType>bo_BillTo</AddressType>
<U_WBCUSTADDID>84</U_WBCUSTADDID>
<U_WBCUSTID>74</U_WBCUSTID>
<UploadURL>BusinessPartners('L10002')</UploadURL>
XmlDocument d1 = new XmlDocument();
foreach (XmlElement data2 in d1.GetElementsByTagName("BusinessPartners"))
XmlElement bpa = (XmlElement)data2.SelectSingleNode("BPAddresses");
XmlElement insertionPoint = bpa;
foreach (XmlElement row in bpa.GetElementsByTagName("row"))
XmlElement addr = d1.CreateElement("BPAddresses");
XmlAttribute attr = d1.CreateAttribute("Array", "http://james.newtonking.com/projects/json");
addr.Attributes.Append(attr);
foreach (XmlElement child in row.GetElementsByTagName("*").Cast<XmlElement>().ToList())
data2.InsertAfter(addr, insertionPoint);
var requestBody = JsonConvert.SerializeXmlNode(data2, Newtonsoft.Json.Formatting.Indented, true);
Console.WriteLine(requestBody);