public static ResourceFunction create(final URI xQueryLocation, final Set<Annotation> annotations) throws ExQueryException {
final ResourceFunctionImpl resourceFunction = new ResourceFunctionImpl();
resourceFunction.setXQueryLocation(xQueryLocation);
if(annotations == null || annotations.isEmpty()) {
throw new ExQueryException("A Resource Function must have at least one RESTXQ Annotation");
}
for(final Annotation annotation : annotations) {
if(!isResourceFunctionAnnotation(annotation.getName())) {
throw new ExQueryException("Annotation is not a valid EXQuery RESTXQ or Serialization Annotation");
}
if(annotation instanceof PathAnnotation) {
resourceFunction.setPathAnnotation((PathAnnotation)annotation);
} else if(annotation instanceof HttpMethodAnnotation) {