replyByType = function (name, json, request, h) {
  if (request.headers.accept === 'application/xml') {
    return h.response(Js2xmlparser(name, json)).type('application/xml');
  }

  return h.response(json).type('application/json');
}
allows a reply to have either a json or xml response

@param  {String} name
@param  {Object} json
@param  {Object} request
@param  {Object} reply