{ for $pdb in distinct-values(//pdb), $hit in //result[pdb=$pdb] return where $hit/score = max(//result[pdb=$pdb]/score) return $hit }