title: Loading Dataset gives error: Source XML is incomplete or invalid
body: <p>I am getting an error when I load a DataSet from a file in VBA.</p>
  
  <p>?RsLoadFromXML("c:\sletmig\test.xml")</p>
  
  <p>Recordset cannot be created. Source XML is incomplete or invalid.</p>
  
  <p>Here is my source code</p>
  
  <pre><code>    Function RsLoadFromXML(sPath As String) As Recordset
      Dim oStream As ADODB.Stream, oRsLoad As ADODB.Recordset
  
      On Error GoTo ErrFailed
  
      Set oRsLoad = New ADODB.Recordset
      oRsLoad.CursorLocation = adUseClient
  
      Set oStream = New ADODB.Stream
      oStream.Charset = "iso-8859-1"
      oStream.Open
      'Load stream
      oStream.LoadFromFile sPath
  
      'Open recordset using stream
      oRsLoad.Open oStream
      Set RsLoadFromXML = oRsLoad
  
      oStream.Close
      Set oStream = Nothing
      Set oRsLoad = Nothing
  
      Exit Function
  
  ErrFailed:
      Debug.Print Err.Description
      Debug.Assert False
      Set RsLoadFromXML = Nothing
  End Function
  </code></pre>
  
  <p>trying to load this test.xml file</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;Instruments&gt;
  &lt;Control&gt;
  &lt;AnalysisNotional&gt;1000000&lt;/AnalysisNotional&gt;
  &lt;TAsOf&gt;18/08/2011&lt;/TAsOf&gt;
  &lt;NumberOfDays&gt;1&lt;/NumberOfDays&gt;
  &lt;/Control&gt;
  &lt;/Instruments&gt;
  </code></pre>