Sorry but that W3schools page is full of it. As usual.
Browsers do NOT check to see what kind of markup you're using. They use the MIME type (sent by your server) to determine if the page is plain text, html, or something else. IE including 9 do not understand the application xhtml+xml MIME type. If you are sending "XHTML" doctyped pages to a browser but are setting text/html as your MIME-type, the browser will consider your page as HTML with errors (closing slashes etc will be ignored as errors). IE will ask you if you want to open the document in something else, like another browser or whatever application you've got running.
Browsers do NOT read the DTD. This is why <!doctype html> works all the way back to IE5. However, sending only the first line of the doctype without the reference url WILL put IE into Quirks Mode and possibly the Almost-Standards modes other browsers have... only because they consider it an incomplete doctype. The DTD is for you and the validator.
If you do not want various versions of IE6 to go into Quirks Mode, set your doctype to char1 line1. IE7 I'm not so sure— IE7 has the <?xml?> prologue bug fixed (does not send IE7 into Quirks Mode) but ordinary comments before the doctype can still put IE7 into Quirks Mode.
As far as I'm concerned, if your back-end language is throwing whitespace and newlines before the doctype, consider it the first place to check if you are getting strange errors in IE.