Looks as if you're trying to learn the language by trial and error - never a good technique, but especially so with XSLT.
In <a href="#{position()}">, the construct "#{position()}" is called an attribute value template. The thing inside the curly braces can be any XPath expression. It can't be an XSLT instruction.
So you want <a href="#{TITLE}{position()}">
Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference