define function f ( $x, $y ) = {$x,' ',$y}; { for $s in doc('data/cs.xml')//gradstudent order by $s/gpa descending, $s//lastname return f( $s/name, $s/gpa/text() ) }