'Converts an object with a bunch of attributes on an object
into a dictionary for use by the `XMLWriter`.
Parameters
obj : object
Any Python object
attrs : sequence of str
Attribute names to pull from the object
Returns
attrs : dict
Maps attribute names to the values retrieved from
``obj.attr``.  If any of the attributes is `None`, it will
not appear in the output dictionary.'

@staticmethod
def object_attrs(obj, attrs):

    d = {}
    for attr in attrs:
        if (getattr(obj, attr) is not None):
            d[attr.replace(u'_', u'-')] = six.text_type(getattr(obj, attr))
    return d
