Recursively process list elements in text output