I am writing something that has to emits structured text by parsing
some internal structures and don't want to write something that has
already been done better by others a million times, so just wanted a
couple of pointers on places to look.

All I want to do is be able to do is build up an output string that
contains nested indented text not dissimilar to the output from YAML,
but I don't need all that  YAML does.

Anything out there that does this?

Thanks
James