Нашел пример по созданию xml файла.
Собственно вот код немного поправленный мной )) :
#!/usr/bin/python
from lxml import etree
from os import getcwd
title = 'title'
content = 'content'
height = 'height'
width = 'width'
version = 'version'
filename = 'filename'
id = '100'
root = etree.Element("initialWindow")
etree.SubElement(root, "title").text = title
etree.SubElement(root, "content").text = content
etree.SubElement(root, "height").text = str(height)
etree.SubElement(root, "width").text = str(width)
app_window = etree.tostring(root)
root = etree.Element("application", xmlns="http://ns.adobe.com/air/application/1.5")
etree.SubElement(root, "id").text = id
etree.SubElement(root, "version").text = version
etree.SubElement(root, "filename").text = filename
#etree.SubElement(root, "name").text = self.name
root.append(etree.XML(app_window))
handle = etree.tostring(root, pretty_print=True, encoding='utf-8')# xml_declaration=True)
path = getcwd()
applic = open(path+'/'+'test.xml', 'w')
applic.writelines(str(handle))
applic.close()
b'<application xmlns="http://ns.adobe.com/air/application/1.5">\n <id>100</id>\n <version>version</version>\n <filename>filename</filename>\n <initialWindow>\n <title>title</title>\n <content>content</content>\n <height>height</height>\n <width>width</width>\n </initialWindow>\n</application>\n'
<application xmlns="http://ns.adobe.com/air/application/1.5">
<id>100</id>
<version>version</version>
<filename>filename</filename>
<initialWindow>
<title>title</title>
<content>content</content>
<height>height</height>
<width>width</width>
</initialWindow>
</application>
Можно ли это исправить?