That's okay as far as it goes.
Probably a simpler approach (which also actually prints the thing) would be to use the 'WebBrowser' ActiveX control. This can be found on the 'Components' dialog box under 'Microsoft Internet Controls'.
To load the XML document, do:
[tt]WebBrowser1.Navigate "<URL of XML document>"[/tt]
Then, on the WebBrowser1_DocumentComplete event, do:
[tt]WebBrowser1.ExecWB OLECMDID_PRINT, OLECMDEXECOPT_DONTPROMPTUSER[/tt]
If the WebBrowser control is made invisible, the user need not even see the document being printed.
Alternatively, the dll upon which this control is based could be used instead (shdocvw.dll) with the same mechanism.