'Creates and saves a new xblock that as a child of the specified block
Returns the newly created item.
Args:
user_id: ID of the user creating and saving the xmodule
parent_usage_key: a :class:`~opaque_key.edx.UsageKey` identifying the
block that this item should be parented under
block_type: The typo of block to create
block_id: a unique identifier for the new item. If not supplied,
a new identifier will be generated
fields (dict): A dictionary specifying initial values for some or all fields
in the newly created block
asides (dict): A dictionary specifying initial values for some or all aside fields
in the newly created block'

def create_child(self, user_id, parent_usage_key, block_type, block_id=None, fields=None, asides=None, **kwargs):

    with self.bulk_operations(parent_usage_key.course_key):
        xblock = self.create_item(user_id, parent_usage_key.course_key, block_type, block_id=block_id, fields=fields, asides=asides, **kwargs)
        if ('detached' in xblock._class_tags):
            return xblock
        new_structure = self._lookup_course(xblock.location.course_key).structure
        block_id = BlockKey.from_usage_key(parent_usage_key)
        if (block_id not in new_structure['blocks']):
            raise ItemNotFoundError(parent_usage_key)
        parent = new_structure['blocks'][block_id]
        if (kwargs.get('position') is None):
            parent.fields.setdefault('children', []).append(BlockKey.from_usage_key(xblock.location))
        else:
            parent.fields.setdefault('children', []).insert(kwargs.get('position'), BlockKey.from_usage_key(xblock.location))
        if (parent.edit_info.update_version != new_structure['_id']):
            self.version_block(parent, user_id, new_structure['_id'])
        self.decache_block(parent_usage_key.course_key, new_structure['_id'], block_id)
        self.update_structure(parent_usage_key.course_key, new_structure)
    return xblock
