Set<org.exquery.xquery3.Annotation> functionRestAnnotations = null;
//process the function annotations
for(final Annotation annotation : annotations) {
if(RestAnnotationFactory.isRestXqAnnotation(annotation.getName().toJavaQName())) {
final org.exquery.xquery3.Annotation restAnnotation = RestAnnotationFactory.getAnnotation(new AnnotationAdapter(annotation));
if(functionRestAnnotations == null) {
functionRestAnnotations = new HashSet<org.exquery.xquery3.Annotation>();
}
functionRestAnnotations.add(restAnnotation);
}