render method

  1. @override
void render(
  1. Response response
)
override

Renders the response by converting the data to XML and writing it to the response.

Implementation

@override
void render(Response response) {
  // Set the content type of the response to 'application/xml'.
  writeContentType(response);

  // Serialize the data to XML format.
  final xmlData = _convertToXml(data);

  // Write the serialized XML data to the response with pretty formatting.
  response.write(xmlData.toXmlString(pretty: true));
}