'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` identifing 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'

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

    parent = None
    if (parent_usage_key is not None):
        parent = self.get_item(parent_usage_key)
        kwargs.setdefault('for_parent', parent)
    xblock = self.create_item(user_id, parent_usage_key.course_key, block_type, block_id=block_id, **kwargs)
    if ((parent is not None) and ('detached' not in xblock._class_tags)):
        if (kwargs.get('position') is None):
            parent.children.append(xblock.location)
        else:
            parent.children.insert(kwargs.get('position'), xblock.location)
        self.update_item(parent, user_id, child_update=True)
    return xblock
