  In this paper we study reproducing kernel Hilbert spaces of arbitrary
smoothness on the sphere $\mathbb{S}^d \subset \mathbb{R}^{d+1}$. The
reproducing kernel is given by an integral representation using the truncated
power function $(\boldsymbol{x} \cdot \boldsymbol{z} - t)_+^{\beta-1}$ defined
on spherical caps centered at $\boldsymbol{z}$ of height $t$, which reduce to
an integral over indicator functions of spherical caps as studied in [J.
Brauchart, J. Dick, arXiv:1101.4448v1 [math.NA], to appear in Proc. Amer. Math.
Soc.] for $\beta = 1$. This is in analogy to the generalization of the
reproducing kernel to arbitrary smoothness on the unit cube.
  We show that the reproducing kernel is a sum of a Kamp{\'e} de F{\'e}riet
function and the Euclidean distance $\|\boldsymbol{x}-\boldsymbol{y}\|$ of the
arguments of the kernel raised to the power of $2\beta -1$ if $2\beta - 1$ is
not an even integer; otherwise the logarithm of the distance
$\|\boldsymbol{x}-\boldsymbol{y}\|$ appears. For $\beta \in \mathbb{N}$ the
Kamp\'e de F\'eriet function reduces to a polynomial, giving a simple closed
form expression for the reproducing kernel.
  Using this space we can generalize Stolarsky's invariance principle to
arbitrary smoothness. Previously, Warnock's formula, which is the analogue to
Stolarsky's invariance principle for the unit cube $[0,1]^s$, has been
generalized using similar techniques [J. Dick, Ann. Mat. Pura. Appl., (4) 187
(2008), no. 3, 385--403].
