Read XSLT 2.0 and XPath 2.0 Programmer's Reference, 4th Edition Online
Authors: Michael Kay
Whitespace and Comments
I have organized the rules in the appendix to make a clear distinction between tokens, which cannot contain internal whitespace, and non-terminals, which can contain whitespace between their individual tokens. This separation is not quite so clear in the W3C specification, which is another result of the complications caused by XQuery. (XQuery uses element constructors that mimic XML syntax, so it does not have such a clear separation between the lexical level of the language and the syntactic level.)