status xquery function