public static Response multiFormatResponse(Object obj, Class clazz, String type, UriInfo uriInfo) throws JAXBException{

		type=type.toLowerCase();
		String[] acceptedTypes = type.split(",");
		for(int i =0; i < acceptedTypes.length ; i++){
			if(typeMap.containsKey(acceptedTypes[i])){

				if(type.startsWith("application/json")){
					return jsonResponse(obj, clazz);
				}

				if(type.startsWith("application/rdf+xml")){
					return rdfResponse(obj, clazz, uriInfo, acceptedTypes[i]);
				}

				if(type.startsWith("text/turtle")){
					return rdfResponse(obj, clazz, uriInfo, acceptedTypes[i]);
				}

				if(type.startsWith("text/n3")){
					return rdfResponse(obj, clazz, uriInfo, acceptedTypes[i]);
				}

				if(type.startsWith("text/html")){
					//return rdfResponse(obj, clazz, uriInfo, "application/rdf+xml");
					return htmlResponse(obj, clazz);		
				}

				if(type.startsWith("application/x-ms-application")){
					return htmlResponse(obj, clazz);
				}

				if(type.startsWith("text/plain")){
					return textResponse(obj, clazz);
				}

			}
		}

		return xmlResponse(obj, clazz);

	}