Imports Newtonsoft.Json
Imports System.Xml
Module XMLtoJSON
Sub Main()
‘ Sample XML
Dim xml As String = “
‘ Load XML to XmlDocument object
Dim doc As New XmlDocument()
doc.LoadXml(xml)
‘ Convert XmlDocument to Json string
Dim json As String = JsonConvert.SerializeXmlNode(doc)
‘ Print the Json string
Console.WriteLine(json)
Console.ReadLine()
End Sub
End Module