Line numbers do not really make sense in xsl, because the structure in the file may differ from the parsed view. A number of questions already cover this, for example, this question
You could use a node position or some kind of identifier to achieve your requirements.
source share