in reply to How to transmit complex data to client?

Just to be sure... “it makes no difference at all whether you have multiple processes or threads.”   Your requirement is ... to send complex (structured...) data to a client.

The very page that you are looking at right now is, of course, an example of “structured data” (a web page) that has been sent from a server (perlmonks) to a client (you).   The mutually agreed-upon format that was used is HTML.   Any “mutually agreed-upon format” could be used.   XML is the one that was designed by a committee.   JSON is the equally-functional (in many but not all cases) “lightweight” format that was not.   YAML is a third alternative that just happens to be my personal favorite.   Each of these has been designed to be easy to transmit on an HTTP circuit, and to be reasonably “human readable,” a very important practical consideration since we humans are going to be the ones who are called-upon to debug the thing.   (Hair follicles are precious.)

As you can surmise, it really does not matter so much which format you “mutually agree upon,” so long as the choice works well for everyone.