sortby in xquery

I am using tamino 3.1.7. I am trying to do a sortby using two attributes MinAvailablity and MaxAvailablity in Stock node.

I am able to sort by one attribute eg
Product[Category=XX]sortby(Stock/@MinAvailabilityDays )
but I am not able to do with two attributes Min and Max days.Is it possible to sortby more than one field.Thanks in advance

I think this should be possible with syntax:

sortby(Stock/@MinAvailabilityDays , Stock/@MaxAvailabilityDays ) 

Does this work for you?

It does work .Thanks.