def METHOD_NAME(node):
    c = []
    # Module statement
    for mod in node.module_declarations():
        c.append(mod)
        c.append(refpolicy.Comment())
    # Requires
    for require in node.requires():
        c.append(require)
    c.append(refpolicy.Comment())
    # Rules
    #
    # We are going to group output by source type (which
    # we assume is the first argument for interfaces).
    rules = []
    rules.extend(node.avrules())
    rules.extend(node.avextrules())
    rules.extend(node.interface_calls())
    rules.sort(key=util.cmp_to_key(rule_cmp))
    cur = None
    sep_rules = []
    for rule in rules:
        if isinstance(rule, refpolicy.InterfaceCall):
            x = rule.args[0]
        else:
            x = util.first(rule.src_types)
        if cur != x:
            if cur:
                sep_rules.append(refpolicy.Comment())
            cur = x
            comment = refpolicy.Comment()
            comment.lines.append("============= %s ==============" % cur)
            sep_rules.append(comment)
        sep_rules.append(rule)
    c.extend(sep_rules)
    ras = []
    ras.extend(node.role_types())
    ras.sort(key=util.cmp_to_key(role_type_cmp))
    if len(ras):
        comment = refpolicy.Comment()
        comment.lines.append("============= ROLES ==============")
        c.append(comment)
    c.extend(ras)
    # Everything else
    for child in node.children:
        if child not in c:
            c.append(child)
    node.children = c