WOResponse response = WOApplication.application().createResponseInContext(_context);
IERXRestWriter writer = _format.writer();
if (writer == null) {
throw new IllegalStateException("There is no writer for the format '" + _format.name() + "'.");
}
writer.appendToResponse(_responseNode, new ERXWORestResponse(response), _format.delegate(), _restContext);
if (_headers.count() > 0) {
for (String key : _headers.keySet()) {
response.setHeader(_headers.objectForKey(key), key);
}
}