Match patterns in XSLT accept only a subset of the XPath expression syntax. This is supposed to make it easier for template matching to be optimized. You can often get around the restrictions by putting the logic inside a predicate, where full XPath expressions are allows. For example
//learnerinformation/(descendant::activity except descendant::*[not(self::activity)]/descendant::activity)/ext_activity
can perhaps be written as
//learnerinformation//activity[not(.[not(self::activity)]/descendant::activity)/ext_activity]
and perhaps it can be simplified further.
Incidentally "//" at the start of a match pattern is nearly always redundant. All it means is "this element must be part of a document".
Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference