def decrease_heading_order(doc, tag=1, order=1):
    """Decrease heading number except specified element (by order).

    The purpose is the same as `decrease_heading`,
    except you specify keep-element by heading number and order.
    So e.g. argument ``'tag=2, order=3'`` means
    third ``<h2>`` tag element in the document.

    >>> el = fromstring('<div><h1>aaa</h1><h1>bbb</h1><h2>ccc</h2></div>')
    >>> decrease_heading_order(el, 1, 2)
    >>> tostring(el)
    '<div><h2>aaa</h2><h1>bbb</h1><h3>ccc</h3></div>'
    """
    for i in range(5, 0, -1):
        for j, el in enumerate(doc.xpath('//h' + str(i))):
            if i == int(tag) and j + 1 == int(order):
                continue
            el.tag = 'h' + str(i + 1)
