ApplicationDocument applicationDocument = ApplicationDocument.Factory.newInstance();
Application application = applicationDocument.addNewApplication();
Resources resources = application.addNewResources();
resources.setBase(myCocktailPath);
Resource resource = resources.addNewResource();
resource.setPath("RESTService/mashupId="+mashupId);
addResource(resource, "json", "format=json", mashup, "application/json");
addResource(resource, "xml", "format=xml", mashup, "application/xml");
addResource(resource, "jsonp", "format=jsonp", mashup, "application/javascript");