The XML declaration is not part of the tree model passed by the XML parser to the XSLT processor.
XSLT can only be used to process well-formed XML documents. If the document isn't well-formed (that is, if it isn't XML), then XSLT is no use to you.
(However, you are wrong to suppose that an XML file with no XML declaration cannot be well-formed)
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference