in reply to Creating A Custom Markup

I suggest you just post-process the output with HTML::PrettyPrinter. I also suggest you switch to Template Toolkit and ttree.