Get declared namespace
Imports <xmlns="http://www.domain.com"> Module Module1 Sub Main() Dim aw As XNamespace = GetXmlNamespace() Dim root As XElement = _ <Root> <Child/> </Root> Console.WriteLine(root) End Sub End Module