title: Convert CSV document to XML
body: <p>I know the question is redundant but I tried all the Python code that I found and modified for my file but they did not work. I need to find a way to convert my file <a href="http://opendata.paris.fr/explore/dataset/tournagesdefilmsparis2011" rel="nofollow">myData.csv</a> in to a XML format file which can be read by a navigator. </p>
  
  <p>I just started to learn Python this month so I'm a beginner. This is my code:</p>
  
  <pre><code>#! usr/bin/python
  # -*- coding: utf-8 -*-
  import csv, sys, os
  from lxml import etree
  
  
  csvFile = 'myData.csv' # création de la variable pour le fichier csv
  reader= csv.reader(open(csvFile), delimiter=';', quoting=csv.QUOTE_NONE) # création d'une variable reader à qui on renvoie le tableau csv
  
  print "&lt;data&gt;"
  for record in reader:
      if reader.line_num == 1:
          header = record
      else:
          innerXml = ""
          dontShow = False
          type = ""
          for i, field in enumerate(record):
              innerXml += "&lt;%s&gt;" % header[i].lower() + field + "&lt;/%s&gt;" % header[i].lower()
              if i == 1 and field == "0":
                  type = "Next"
              elif type == "" and i == 3 and field == "0":
                  type = "Next"
              elif type == "" and i == 3 and field != "0":
                  type = "film"
  
              if i == 1 and field == "X":
                  dontShow = True
  
          if dontShow == False:
              xml = "&lt;%s&gt;" % type
              xml += innerXml
              xml += "&lt;/%s&gt;" % type
              print xml
  print "&lt;/data&gt;"
  </code></pre>