String functionName = xqwsSOAPFunction.getNodeName();
String functionName = xqwsSOAPFunction.getLocalName(); if(functionName==null) { functionName=xqwsSOAPFunction.getNodeName(); }
    private CompiledXQuery XQueryExecuteXQWSFunction(DBBroker broker, Node xqwsSOAPFunction, XQWSDescription xqwsDescription, HttpServletRequest request, HttpServletResponse response) throws XPathException    {	    	StringBuffer query = new StringBuffer();    	query.append("xquery version \"1.0\";" + SEPERATOR);    	query.append(SEPERATOR);        query.append("import module namespace " + xqwsDescription.getNamespace().getLocalName() + "=\"" + xqwsDescription.getNamespace().getNamespaceURI() + "\" at \"" + xqwsDescription.getFileURI().toString() + "\";" + SEPERATOR);        query.append(SEPERATOR);                //add the function call to the xquery        String functionName = xqwsSOAPFunction.getNodeName();        query.append(xqwsDescription.getNamespace().getLocalName() + ":" + functionName + "(");                //add the arguments for the function call if any        NodeList xqwsSOAPFunctionParams = xqwsSOAPFunction.getChildNodes();        Node nInternalFunction = xqwsDescription.getFunction(functionName);        NodeList nlInternalFunctionParams = xqwsDescription.getFunctionParameters(nInternalFunction);                int j = 0;        for(int i = 0; i < xqwsSOAPFunctionParams.getLength(); i++)        {        	Node nSOAPFunctionParam = xqwsSOAPFunctionParams.item(i);        	if(nSOAPFunctionParam.getNodeType() == Node.ELEMENT_NODE)        	{	        	query.append(writeXQueryFunctionParameter(xqwsDescription.getFunctionParameterType(nlInternalFunctionParams.item(j)), xqwsDescription.getFunctionParameterCardinality(nlInternalFunctionParams.item(j)), nSOAPFunctionParam));        		query.append(","); //add function seperator	        		        	j++;        	}        }                //remove last superflurous seperator		if(query.charAt(query.length()-1) == ',')		{			query.deleteCharAt(query.length()-1);		}                query.append(")");                //compile the query        return compileXQuery(broker, new StringSource(query.toString()), new XmldbURI[] { xqwsDescription.getCollectionURI() }, xqwsDescription.getCollectionURI(), request, response);    }