Convert the nested list to a formatted string.