'Ensure that all nodes with the same play_order have the same href and
with different play_orders have different hrefs.'

def rationalize_play_orders(self):

    def po_node(n):
        for x in self.iter():
            if (x is n):
                return
            if (x.play_order == n.play_order):
                return x
    def href_node(n):
        for x in self.iter():
            if (x is n):
                return
            if (x.href == n.href):
                return x
    for x in self.iter():
        y = po_node(x)
        if (y is not None):
            if (x.href != y.href):
                x.play_order = getattr(href_node(x), 'play_order', self.next_play_order())
        y = href_node(x)
        if (y is not None):
            x.play_order = y.play_order
