'Loads the proper when by attributes of elem'

@classmethod
def from_elem(self, parent, elem):

    when_type = elem.get('type')
    assert (when_type in when_type_to_class), TypeError(('When    type    not    implemented:    %s' % when_type))
    return when_type_to_class[when_type].from_elem(parent, elem)
