}
UrlBuilder url = new UrlBuilder(link);
// compile query request
final CmisQueryType query = new CmisQueryType();
query.setStatement(statement);
query.setSearchAllVersions(searchAllVersions);
query.setIncludeAllowableActions(includeAllowableActions);
query.setIncludeRelationships(convert(EnumIncludeRelationships.class, includeRelationships));
query.setRenditionFilter(renditionFilter);
query.setMaxItems(maxItems);
query.setSkipCount(skipCount);
// post the query and parse results
HttpUtils.Response resp = post(url, Constants.MEDIATYPE_QUERY, new HttpUtils.Output() {
public void write(OutputStream out) throws Exception {
JaxBHelper.marshal(JaxBHelper.CMIS_OBJECT_FACTORY.createQuery(query), out, false);