'Create an XBlock with `parent_loc` (the location of the parent block)
and `xblock_desc` (an `XBlockFixtureDesc` instance).'

def create_xblock(self, parent_loc, xblock_desc):

    create_payload = {'category': xblock_desc.category, 'display_name': xblock_desc.display_name}
    if (parent_loc is not None):
        create_payload['parent_locator'] = parent_loc
    response = self.session.post((STUDIO_BASE_URL + '/xblock/'), data=json.dumps(create_payload), headers=self.headers)
    if (not response.ok):
        msg = 'Could    not    create    {0}.        Status    was    {1}'.format(xblock_desc, response.status_code)
        raise FixtureError(msg)
    try:
        loc = response.json().get('locator')
        xblock_desc.locator = loc
    except ValueError:
        raise FixtureError("Could    not    decode    JSON    from    '{0}'".format(response.content))
    response = self.session.post(((STUDIO_BASE_URL + '/xblock/') + loc), data=xblock_desc.serialize(), headers=self.headers)
    if response.ok:
        return loc
    else:
        raise FixtureError('Could    not    update    {0}.        Status    code:    {1}'.format(xblock_desc, response.status_code))
