def METHOD_NAME(e):
    for o in e.ownedElement:
        if o.owner is e:
            for ref, data in copy(o):
                if ref not in elements:
                    elements[ref] = data
                    METHOD_NAME(o)