<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def create_transcript_objects(xml, edx_video_id, resource_fs, static_dir, external_transcripts):
 """ Create VideoTranscript objects. Arguments: xml (Element):
 lxml Element object. edx_video_id (str):
 Video id of the video. resource_fs (OSFS):
 Import file system. static_dir (str):
 The Directory to retrieve transcript file. external_transcripts (dict):
 A dict containing the list of names of the external transcripts. Example: { 'en': ['The_Flash.srt', 'Harry_Potter.srt'], 'es': ['Green_Arrow.srt'] } """

    # File system should not start from /draft directory.
    with open_fs(resource_fs.root_path.split('/drafts')[0]) as file_system:
        # First import VAL transcripts.
        for transcript in xml.findall('.//transcripts/transcript'):
            try:
                file_format = transcript.attrib['file_format']
                language_code = transcript.attrib['language_code']
                transcript_file_name = u'{edx_video_id}-{language_code}.{file_format}'.format(
                    edx_video_id=edx_video_id,
                    language_code=language_code,
                    file_format=file_format
                )

                import_transcript_from_fs(
                    edx_video_id=edx_video_id,
                    language_code=transcript.attrib['language_code'],
                    file_name=transcript_file_name,
                    provider=transcript.attrib['provider'],
                    resource_fs=file_system,
                    static_dir=static_dir
                )
            except KeyError:
                logger.warn("VAL: Required attributes are missing from xml, xml=[%s]", etree.tostring(transcript).strip())

        # This won't overwrite transcript for a language which is already present for the video.
        for language_code, transcript_file_names in six.iteritems(external_transcripts):
            for transcript_file_name in transcript_file_names:
                import_transcript_from_fs(
                    edx_video_id=edx_video_id,
                    language_code=language_code,
                    file_name=transcript_file_name,
                    provider=TranscriptProviderType.CUSTOM,
                    resource_fs=file_system,
                    static_dir=static_dir
                )