Add namespace to XElement
Imports System Imports System.Xml Imports System.Xml.Schema Class MainClass Shared Sub Main() Dim aw As XNamespace = "http://www.domain.com" Dim root As XElement = New XElement(aw + "Root", _ New XAttribute(XNamespace.Xmlns + "aw", "http://www.domain.com"), _ "Content") Console.WriteLine(root) End Sub End Class