code: def create_transcripts_xml(video_id, video_el, resource_fs, static_dir):
      
      video_transcripts = VideoTranscript.objects.filter(video__edx_video_id=video_id).order_by('language_code')
      # create transcripts node only when we have transcripts for a video
      if video_transcripts.exists():
          transcripts_el = SubElement(video_el, 'transcripts')
  
      transcript_files_map = {}
      for video_transcript in video_transcripts:
          language_code = video_transcript.language_code
          file_format = video_transcript.file_format
  
          try:
              transcript_filename = create_transcript_file(
                  video_id=video_id,
                  language_code=language_code,
                  file_format=file_format,
                  resource_fs=resource_fs.delegate_fs(),
                  static_dir=combine(u'course', static_dir)  # File system should not start from /draft directory.
              )
              transcript_files_map[language_code] = transcript_filename
          except TranscriptsGenerationException:
              # we don't want to halt export in this case, just log and move to the next transcript.
              logger.exception('[VAL] Error while generating "%s" transcript for video["%s"].', language_code, video_id)
              continue
  
          SubElement(
              transcripts_el,
              'transcript',
              {
                  'language_code': language_code,
                  'file_format': Transcript.SRT,
                  'provider': video_transcript.provider,
              }
          )
  
      return dict(xml=video_el, transcripts=transcript_files_map)
docs: Creates xml for transcripts.
      For each transcript element, an associated transcript file is also created in course OLX.
  
      Arguments:
          video_id (str): Video id of the video.
          video_el (Element): lxml Element object
          static_dir (str): The Directory to store transcript file.
          resource_fs (SubFS): The file system to store transcripts.
  
      Returns:
          lxml Element object with transcripts information