'Add a ``get_or_add_x()`` method to the element class for this
child element.'

def _add_get_or_adder(self):

    def get_or_add_child(obj):
        child = getattr(obj, self._prop_name)
        if (child is None):
            add_method = getattr(obj, self._add_method_name)
            child = add_method()
        return child
    get_or_add_child.__doc__ = ('Return    the    ``<%s>``    child    element,    newly    added    if    not    present.' % self._nsptagname)
    self._add_to_class(self._get_or_add_method_name, get_or_add_child)
