title: Clean up translation output after xml file translation
body: <p>I need to translate some WORD files (.docx) and I'm doing so by extracting the 'document.xml' file and translating it with YandexTranslate.</p>
  
  <p>My code :</p>
  
  <pre><code>import xml.etree.ElementTree as Et
  from yandex_translate import YandexTranslate
  import zipfile
  
  with zipfile.ZipFile('myfrenchfile.docx') as zf:
      zf.extract(r'word/document.xml')
  
  with open('word/document.xml', encoding='utf-8') as f:
      tree = Et.parse(f)
      root = tree.getroot()
  
      for elem in root.getiterator():
          translate = YandexTranslate(
              'myyandexkey')
          try:
              if elem.text:
                  elem.text = elem.text.replace(elem.text, str(translate.translate(elem.text, 'en')))
          except AttributeError:
              pass
  
  tree.write('document.xml', encoding='utf-8')
  </code></pre>
  
  <p>This works but since I'm forced to pass 'str' on 'translate.translate()' for the translation to work I get an output populated with «{'lang': 'fr-en', 'code': 200, 'text': ['» and similar. I've tried the replace method as in</p>
  
  <pre><code>str(translate.translate(elem.text, 'en')).\
                      replace('{\'lang\': \'fr-en\', \'code\': 200, \'text\': [\'', '').\
                      replace('\']}', '').replace('{\'lang\': \'en-en\', \'code\': 200, \'text\': [\'', '').\
                      replace('{\'lang\': \'en-en\', \'text\': [\'', '').\
                      replace('\'], \'code\': 200}', '').replace('{\'code\': 200, \'lang\': \'en-en\', \'text\': [\'', '')\
                      .replace('{\'code\': 200, \'lang\': \'fr-en\', \'text\': [\'', '').\
                      replace('{\'code\': 200, \'lang\': \'de-en\', \'text\': [\'', '').\
                      replace('{\'lang\': \'de-en\', \'code\': 200, \'text\': [\'', '')
  </code></pre>
  
  <p>If I print the output, it's clean, but when the file is written it's not.</p>
  
  <p>Does someone have a solution to write the translation text only to the new xml file?</p>