that would be cool, yes....but no work has been done here
some thoughts on the way:
SQL returns tuples (from a newly generated table)
AsTMa? can do that, but it also can return XML content
and AsTMa? statements are rather similar to XQuery statements:
<students>{
forall [ $s is-a student ]
return
<student SID="{$s/in(SID)}">
<name>{$s/bn}</name>
</student>
}</students>