def _convert_block_list_to_xml(block_id_list):
if block_id_list is None:<EOL><INDENT>return '<STR_LIT>'<EOL><DEDENT>block_list_element = ETree.Element('<STR_LIT>');<EOL>for block in block_id_list:<EOL><INDENT>if block.id is None:<EOL><INDENT>raise ValueError(_ERROR_INVALID_BLOCK_ID)<EOL><DEDENT>id = xml_escape(_str(format(_encode_base64(block.id))))<EOL>ETree.SubElement(block_list_element, block.state).text = id<EOL><DEDENT>try:<EOL><INDENT>stream = BytesIO()<EOL>ETree.ElementTree(block_list_element).write(stream, xml_declaration=True, encoding='<STR_LIT:utf-8>', method='<STR_LIT>')<EOL><DEDENT>except:<EOL><INDENT>raise<EOL><DEDENT>finally:<EOL><INDENT>output = stream.getvalue()<EOL>stream.close()<EOL><DEDENT>return output<EOL>
<?xml version="1.0" encoding="utf-8"?>
<BlockList>
  <Committed>first-base64-encoded-block-id</Committed>
  <Uncommitted>second-base64-encoded-block-id</Uncommitted>
  <Latest>third-base64-encoded-block-id</Latest>
</BlockList>

Convert a block list to xml to send.

block_id_list:
    A list of BlobBlock containing the block ids and block state that are used in put_block_list.
Only get block from latest blocks.