'Exports Library Content Module to XML'

def definition_to_xml(self, resource_fs):

    xml_object = etree.Element('library_content')
    for child in self.get_children():
        self.runtime.add_block_as_child_node(child, xml_object)
    for (field_name, field) in self.fields.iteritems():
        if (field_name in ('children', 'parent', 'content')):
            continue
        if field.is_set_on(self):
            xml_object.set(field_name, unicode(field.read_from(self)))
    return xml_object
