code: def console_writer(msg, tab=-1):
      
      tab += 1
  
      if isinstance(msg, Model):
          msg = fromstring(msg.render(encoding='utf-8'))
  
      print('%s`- %s: %s %s' % (
          '  ' * tab,
          click.style(msg.tag, bold=True),
          click.style(msg.text, fg='red') if msg.text is not None else '',
          click.style(repr(msg.attrib), fg='green', bold=True) if msg.attrib.keys() else ''
      ))
      for c in msg.getchildren():
          print('  %s`- %s: %s %s' % (
              '  ' * tab,
              click.style(c.tag, bold=True),
              click.style(c.text, fg='red') if c.text is not None else '',
              click.style(repr(c.attrib), fg='green', bold=True) if c.attrib.keys() else ''
          ))
          for sc in c.getchildren():
              tab += 1
              console_writer(sc, tab)
              tab -= 1
docs: Internal API: Returns a prettified tree-based output of an XML message for debugging purposes. This helper function
      is used by the debug-transform command.