def METHOD_NAME(self, capabilities, indent=None, root=False):
    if root:
        print("# Note: This is not a valid MapProxy configuration!")
        print('Capabilities Document Version %s' % (self.version,))
        print('Root-Layer:')
        layer_list = capabilities.layers()['layers']
    else:
        layer_list = capabilities['layers']
    indent = indent or self.indent
    for layer in layer_list:
        marked_first = False
        # print ordered items first
        for item in self.print_order:
            if layer.get(item, False):
                if not marked_first:
                    marked_first = True
                    self._format_output(item, layer[item], indent, mark_first=marked_first)
                else:
                    self._format_output(item, layer[item], indent)
        # print remaining items except sublayers
        for key, value in iteritems(layer):
            if key in self.print_order or key == 'layers':
                continue
            self._format_output(key, value, indent)
        # print the sublayers now
        if layer.get('layers', False):
            self.print_line(indent, 'layers')
            self.METHOD_NAME(layer, indent=indent+self.indent)