code: def onekgreek_tei_xml_to_text_capitains():
      
      file = os.path.expanduser(
          '~/cltk_data/greek/text/greek_text_first1kgreek/data/tlg0627/tlg021/tlg0627.tlg021.1st1K-grc1.xml')
      xml_dir = os.path.expanduser('~/cltk_data/greek/text/greek_text_first1kgreek/data/*/*/*.xml')
      xml_paths = glob.glob(xml_dir)
      if not len(xml_paths):
          logger.error('1K Greek corpus not installed. Use CorpusInstaller to get `First1KGreek`.')
          raise FileNotFoundError
      xml_paths = [path for path in xml_paths if '__cts__' not in path]
  
      # new dir
      new_dir = os.path.expanduser('~/cltk_data/greek/text/greek_text_first1kgreek_plaintext/')
      if not os.path.isdir(new_dir):
          os.makedirs(new_dir)
  
      for xml_path in xml_paths:
          _, xml_name = os.path.split(xml_path)
          xml_name = xml_name.rstrip('.xml')
          xml_name += '.txt'
  
          plain_text = ''
          with open(xml_path) as file_open:
              text = CapitainsCtsText(resource=file_open)
              for ref in text.getReffs(level=len(text.citation)):
                  psg = text.getTextualNode(subreference=ref, simple=True)
                  text_line = psg.export(Mimetypes.PLAINTEXT, exclude=["tei:note"])
                  plain_text += text_line
  
          new_plaintext_path = os.path.join(new_dir, xml_name)
          with open(new_plaintext_path, 'w') as file_open:
              file_open.write(plain_text)
docs: Use MyCapitains program to convert TEI to plaintext.