Did you know you can determine if a number is prime by calling an XQuery query? Here’s the code:
<prime_numbers> { for $a in (1 to 50) return( if(not(some $counter in (2 to ($a - 1)) satisfies $a mod $contor=0)) then {$a} else {$a} ) }
And here’s a fragment of the result:
1 2 3 4 5 6 7 8 ...