import csv

reader = csv.reader(open('wunder-data.txt', 'r'), delimiter="\t")
f = open('wunder-data.xml', 'w')
f.write('<weather_data>')

for row in reader:
    f.write('\t' + '<observation>')
    f.write('\t' + '\t' + '<date>' + row[0] + '</date>')
    f.write('\t' + '\t' + '<max_temperature>' + row[1] + '</max_temperature>')
    f.write('\t' + '</observation>')

f.write('</weather_data>')
f.close()
