microservice , architectura

Hi, I'm working on a project with multiple microservices. One microservice manages products, where products can be structured in a tree format (with sub-products). This service returns product data as a DTO.

There is another microservice responsible for export, which receives product data in the tree format and converts it into a file for download.

Additionally, there is a third service acting as a gateway, returning responses to the client by interacting with other microservices.

My question is: How should I implement the logic for converting product data into a string? Should this be done in the product management service, returning the data in the desired format, or is it better to do it in the export service (since it already receives the product tree)? I'm a bit concerned that adding this logic to the export service might violate the SRP principle. Or, should this logic be handled in the main gateway service?

Since the product data needs to be returned as a string, what would be the best approach from an architectural standpoint?

I’d appreciate your thoughts!