<p>What criteria should I use to decide whether I write VBA code like this:</p>

<pre><code>Set xmlDocument = New MSXML2.DOMDocument
</code></pre>

<p>or like this:</p>

<pre><code>Set xmlDocument = CreateObject("MSXML2.DOMDocument")
</code></pre>

<p>?</p>

For the former you need to have a reference to the type library in your application.  It will typically use early binding (assuming you declare your variable as MSXML2.DOMDocument rather than as Object, which you probably will), so will generally be faster and will give you intellisense support.
The latter can be used to create an instance of an object using its ProgId without needing the type library.  Typically you will be using late binding.
Normally it's better to use "As New" if you have a type library, and benefit from early binding.