You have to iterate through the document childNodes and getting the outerHTML content.
in VBA it looks like this
For Each e In document.ChildNodes
Put ff, , e.outerHTML & vbCrLf
Next e
using this, allows you to get all elements of the web page including < !DOCTYPE > node if it exists