Mega Code Archive

 
Categories / VB.Net / XML
 

Create an XML tree with nested namespaces

Imports System Imports System.Xml Imports System.Xml.XPath Public Class MainClass     Public Shared Sub Main()         Dim root As XDocument = _              <?xml version='1.0'?>             <Root xmlns='http://www.domain.com'>                 <Child xmlns='www.AnotherDomain.com'>                 <DifferentChild xmlns='http://www.domain.com'>other content</DifferentChild>                 </Child>             </Root>         Console.WriteLine(root)     End Sub End Class