This:
<xsl:for-each select="key('kbook', title)">
<xsl:value-of select="sum(counts)"/>
</xsl:for-each>
says "for each of the books with this title, add up all the <counts> elements for this book and output the total. There's only one <counts> for each book, so that's the value you get.
What you want is a single value, not one for each book:
<xsl:value-of select="key('kbook', title)/counts"/>
Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference