Imports System.IO ' Yep, VB.NET can import XML namespaces. All literals have xmlns changed, while xmlns:xlink is only ' declared in literals that use it directly (e.g. the output of this program has it defined in both ' of the tags and not the root, ). Imports Imports Module Program Sub Main() Dim doc = ' XML literals don't support DTDs. Dim type As New XDocumentType(name:="svg", publicId:="-//W3C//DTD SVG 1.1//EN", systemId:="http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd", internalSubset:=Nothing) doc.AddFirst(type) Dim draw_yinyang = Sub(trans As Double, scale As Double) doc.Root.Add(/>) draw_yinyang(20, 0.05) draw_yinyang(8, 0.02) Using s = Console.OpenStandardOutput(), sw As New StreamWriter(s) doc.Save(sw, SaveOptions.OmitDuplicateNamespaces) sw.WriteLine() End Using End Sub End Module