Listing A—SetupCatalogDoc
Private Sub SetupCatalogDoc()
    Dim Version As MSXML2.IXMLDOMProcessingInstruction  '<?xml version="1.0"?>
      
    'Create a new document object
    Set Me.CatalogDoc = New MSXML2.DOMDocument40
    CatalogDoc.preserveWhiteSpace = False
    CatalogDoc.async = False
    'tell the parser to automatically load externally defined DTD's or XSD's
    CatalogDoc.resolveExternals = True
  
    Set Version = CatalogDoc.createProcessingInstruction("xml", "version=" & Chr(34) & "1.0" & Chr(34))
      
    'create the root catalog element
    'and append it and the XML version to the document
    CatalogDoc.appendChild Version
    CatalogDoc.appendChild CatalogDoc.createElement("catalog")
  
End Sub