try this
Private Sub WriteXmlToFile(thisDataSet As DataSet)
If thisDataSet Is Nothing Then
Return
End If
Dim filename As String = "XmlDoc.xml"
Dim stream As New System.IO.FileStream _
(filename, System.IO.FileMode.Create)
thisDataSet.WriteXml(stream)
End Sub