Hi Marco,
As an alternative you could try to run the transformation id on the structure in order to convert the structure to an XML string and then run a Simple or XSLT transformation in order to replace the XML tags with the custom delimiter (or do this second step with a normal search and replace).
The upside of this approach would be that you don't need any dynamic lookup of the input's structure.
I cannot state anything about the performance of this approach but you could give it a try and compare this to the approach you already have.
Regards,
Valentin