If you want a single sum for the whole source document, that's sum(/test/oppgave/poeng). Doing the sum() inside a for-each would only be appropriate if you want multiple totals (ie. subtotals).
Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference