prototyped pretty printer for list and docentities