Sub XML2WML()

  Const strPath = "c:\KAP22"
  Dim objXSLTransform As MSXML2.DOMDocument50
  Dim objXMLDocument As MSXML2.DOMDocument50
  Dim objWordMLDocument As MSXML2.DOMDocument50

  Set objXSLTransform = New MSXML2.DOMDocument50
  Set objXMLDocument = New MSXML2.DOMDocument50
  Set objWordMLDocument = New MSXML2.DOMDocument50

  objXSLTransform.async = False
  If Not objXSLTransform.Load(strPath & "\BSP22_23.xsl") Then
    MsgBox "XSL-Transformationsdatei konnte nicht gefunden werden"
  Else
    If objXSLTransform.parseError.errorCode <> 0 Then
      MsgBox "Parse error in XSL-Transform: " & objXSLTransform.parseError.reason
    Else
      objXMLDocument.async = False
      If Not objXMLDocument.Load(strPath & "\BSP22_02a.xml") Then
        MsgBox "XML-Datei konnte nicht gefunden werden"
      Else
        If objXMLDocument.parseError.errorCode <> 0 Then
          MsgBox "Parse error in XML-Datei: " & objXMLDocument.parseError.reason
        Else
          objXMLDocument.transformNodeToObject objXSLTransform, objWordMLDocument
          objWordMLDocument.Save strPath & "\BSP22_26.xml"
        End If
      End If
    End If
  End If

  Set objWordMLDocument = Nothing
  Set objXMLDocument = Nothing
  Set objXSLTransform = Nothing

End Sub