User defined Function fo XQuery using X-Tension

Hi,

I have some Problem with the XQuery functions.
The current implementation doesn’t support user defined function in XQuery.
So I think to implement the function in Tamino X-Tension and call this function in XQuery. And it works.

Some functions that XQuery doesn’t have are Bit Operator and also the google syntax, see http://dsd.lbl.gov/nux/

The last day I implement a complex XQuery which uses also X-Tension.
But I have a problem, that the Java X-Tension doesn’t accept Array/Sequence variable as Parameter, which I build in XQuery.

Is there any way, how to implement it ?

Code :
public boolean isPermitted (String rightsToCheck, int permissionToCheck)
{
boolean permitted = false;
// TODO: Add your SXF implementation here.
// To delete isPermitted, remove it here and from Install.xml.

            int numberOfRights = rightsToCheck.length;
            int maskToCheck;
            for(int i = 0 ; i < numberOfRights ; i++){
                    if(rightsToCheck[i].compareTo("0") == 0 || rightsToCheck[i] == "0"){
                            return permitted;
                    }else if(rightsToCheck[i].compareTo("") != 0 && rightsToCheck[i] != "" && rightsToCheck[i] != null){
                            maskToCheck = Integer.parseInt(rightsToCheck[i]);
                            permitted = ((maskToCheck & permissionToCheck) == permissionToCheck);
                            if(permitted == true)
                                    return permitted;
                    }
            }
            return permitted;

}