Define
$$F_n(a)=a^n\int_0^\pi\sin^{2n}x\cos(a\cos x)\,dx$$
Then differentiating on $a$ yields
$$F_n'(a)=na^{n-1}\int_0^\pi\sin^{2n}x\cos(a\cos x)\,dx - a^n\int_0^\pi\sin^{2n}x\cos x\sin(a\cos x)\,dx$$
$$F_n''(a)=n(n-1)a^{n-2}\int_0^\pi\sin^{2n}x\cos(a\cos x)\,dx - 2na^{n-1}\int_0^\pi\sin^{2n}x\cos x\sin(a\cos x)\,dx - a^n\int_0^\pi\sin^{2n}x\cos^2x\cos(a\cos x)\,dx$$
Then we can verify that $F$ satisfies Bessel's differential equation:
$$a^2F_n''(a)+aF_n'(a)+(a^2-n^2)F_n(a)=a^{n+1}\int_0^\pi\sin^{2n}x(a\sin^2x\cos(a\cos x)-(2n+1)\cos x\sin(a\cos x))\,dx$$
$$=a^{n+1}[-\sin^{2n+1}x\sin(a\cos x)]_0^\pi=0$$
Since $F_n(0)$ is well-defined for $n\ge0$, $Y_n(a)$ cannot appear in the solution and
$$F_n(a)=c(n)J_n(a)$$
$c(n)$ can be determined from the series expansion of the integral, and finally we have
$$\int_0^\pi\sin^nx\cos(a\cos x)\,dx=\sqrt\pi\left(\frac2a\right)^{n/2}\Gamma\left(\frac{n+1}2\right)J_{n/2}(a)$$
which holds for all nonnegative real $n$, not just integers. For odd $n$ the $J_{n/2}(a)$ term can be rewritten as its spherical counterpart $j_{(n-1)/2}(a)$, which in turn is a rational function of $\cos a,\sin a$ and $a$.