Another weird original which can be improved esp w/ your xblock refactoring:
``` python
    def get_map_for_field(cls, attr):
        """
        Returns a serialize/deserialize AttrMap for the given field of a class.
        """
        if cls.fields.has(attr):
            field = cls.fields[attr]
            from_xml = lambda val: deserialize_field(field, val)
            to_xml = lambda val: serialize_field(val)
            return AttrMap(from_xml, to_xml)
        else:
            return AttrMap()
```