In VB 6.0, you would write the XML Declaration like this:
Dim memory_stream As New MemoryStream
Dim xmlTextWriter As New XmlTextWriter(memory_stream, System.Text.Encoding.UTF8)
' Write the XML declaration.
xmlTextWriter.WriteStartDocument(True)
And if you happen to migrate to VB.Net anytime, you could use the XMLDocument class's CreateXmlDeclaration method. Sample snippet provided below.
//Create or Load the Xml Document.
XmlDocument xmlDoc = new XmlDocument();
//Create an XML declaration.
XmlDeclaration xmlDeclartion = xmlDoc.CreateXmlDeclaration("1.0",null,null);