XSLT and the missing xml declaration

I was wondering why oh why after my xsl-t transformations the xml header was not outputted correctly… And guess what, hidden as a small side note, I see this:

Note   The <xsl:output> statement is ignored when the output of the XslTransform.Transform method is an XmlReader or XmlWriter.

Now this was well well hidden and explain a lot of things…