Create xml from datatable/excel

I want to create XML from datatable, and am using .net code something like this

Dim doc As System.Xml.XmlDocument=Nothing
Dim docNode As System.Xml.XmlNode=Nothing

Dim CounterpartyInformation As System.Xml.XmlNode=Nothing ‘Root element’
Dim CounterpartyRegion As System.Xml.XmlNode=Nothing ‘Sub Element’
Dim CounterpartyCountry As System.Xml.XmlNode=Nothing ‘Sub Element’

doc=New System.Xml.XmlDocument()
Console.WriteLine(“i am here”)
docNode=doc.CreateXmlDeclaration(“1.0”, “UTF-8”,Nothing)
doc.AppendChild(docNode)
Console.WriteLine(“i am here line 20”)

CounterpartyInformation=doc.CreateElement(“CounterpartyInformation”)
doc.AppendChild(CounterpartyInformation)
Console.WriteLine(“i am here line 24”)
CounterpartyRegion=doc.CreateElement(“CounterpartyRegion”) ‘Sub Element’
CounterpartyRegion.AppendChild(doc.CreateTextNode(“Sirius”)) ‘Sub Element Value’
CounterpartyInformation.AppendChild(CounterpartyRegion)
Console.WriteLine(“i am here line 28”)
CounterpartyCountry=doc.CreateElement(“CounterpartyCountry”) ‘Sub Element’
CounterpartyCountry.AppendChild(doc.CreateTextNode(“GB”)) ‘Sub Element Value’
CounterpartyInformation.AppendChild(CounterpartyCountry)

doc.Save(“C:\Users\abc.xyz\Documents\UiPath\BlankProcess\ff.xml”)‘change the path of the file’
Console.WriteLine(“i am done now”)

I want that ‘Sub Element Value’ from the excel/datatable
Thanks in Advance

@tejastandel007
Have a Look on this method
https://docs.microsoft.com/en-us/dotnet/api/system.data.datatable.writexml?view=netframework-4.8

Also on the Go Plattform there are some custom components available as well