<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>COPYING</filename>
    </added>
    <added>
      <filename>README</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -1,26 +1,27 @@
 #!/usr/bin/python2.5
 &quot;&quot;&quot;
-    This file is part of SleekXMPP.
+    This file is part of SleekMigrate.
 
-    SleekXMPP is free software; you can redistribute it and/or modify
+    SleekMigrate is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
     the Free Software Foundation; either version 2 of the License, or
     (at your option) any later version.
 
-    SleekXMPP is distributed in the hope that it will be useful,
+    SleekMigrate is distributed in the hope that it will be useful,
     but WITHOUT ANY WARRANTY; without even the implied warranty of
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     GNU General Public License for more details.
 
     You should have received a copy of the GNU General Public License
-    along with SleekXMPP; if not, write to the Free Software
+    along with SleekMigrate; if not, write to the Free Software
     Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 &quot;&quot;&quot;
 
 import logging
 import sleekxmpp.sleekxmpp as sleekxmpp
 from optparse import OptionParser
-#from xml.etree import Element
+from xml.etree import ElementTree as ET
+
 import os
 import time
 import csv
@@ -70,28 +71,34 @@ class TigaseCSVExporter(object):
 
 class XEP0227Exporter(object):
     def __init__(self, fileName, host):
-        logging.warning(&quot;STUPID STRINGS - MAKE REAL XML&quot;)
-        self.out = file(fileName, &quot;w&quot;)
-        self.out.write(u&quot;&quot;&quot;&lt;?xml version='1.0' encoding='UTF-8'?&gt;
-&lt;server-data xmlns='http://www.xmpp.org/extensions/xep-0227.html#ns'&gt;
-        &quot;&quot;&quot;)
-        self.out.write(u&quot;&lt;host jid='%s'&gt;\n&quot; % host)
+        self.fileName = fileName
+        self.element = ET.Element('{http://www.xmpp.org/extensions/xep-0227.html#ns}server-data')
+        hostElement = ET.Element('host')
+        hostElement.set('jid', host)
+        self.element.append(hostElement)
         
     def export(self, user):
         logging.info(&quot;Exporting account &quot; + user.jid)
-        self.out.write(u&quot;&lt;user name='%s' password='%s'&gt;&lt;query xmlns='jabber:iq:roster'&gt;&quot; % (user.user(), user.password))
-        
+        userElement = ET.Element('user')
+        userElement.set('name', user.user())
+        userElement.set('password', user.password)
+        rosterElement = ET.Element('{jabber:iq:roster}query')
         for rosterEntry in user.rosterEntries:
-            self.out.write(u&quot;&lt;item jid='%s' name='%s' subscription='%s'&gt;&quot; % (rosterEntry.jid, rosterEntry.name, rosterEntry.subscription))
+            itemElement = ET.Element('item')
+            itemElement.set('jid', rosterEntry.jid)
+            itemElement.set('name', rosterEntry.name)
+            itemElement.set('subscription', rosterEntry.subscription)
             for group in rosterEntry.groups:
                 if group is not None:
-                    self.out.write(u&quot;&lt;group&gt;%s&lt;/group&gt;&quot; %group)
-            self.out.write(u&quot;&lt;/item&gt;&quot;)
-        self.out.write(u&quot;&lt;/query&gt;&lt;/user&gt;&quot;) 
+                    groupElement = ET.Element('group')
+                    groupElement.text = group
+                    itemElement.append(groupElement)
+            rosterElement.append(itemElement)
+        userElement.append(rosterElement)
+        self.element.append(userElement)
         
     def finalise(self):
-        self.out.write(u&quot;&lt;/host&gt;&lt;/server-data&gt;&quot;)
-        self.out.close()
+        ET.ElementTree(self.element).write(self.fileName)
 
 class XMPPAccountExtractor(sleekxmpp.xmppclient):
     def __init__(self, jid, password, ssl=False, plugin_config = {}, plugin_whitelist=[]):</diff>
      <filename>sleekmigrate.py</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>ecd767d176962c976ef01592bf802e9702f1370b</id>
    </parent>
  </parents>
  <author>
    <name>Kevin Smith</name>
    <email>kevin@kismith.co.uk</email>
  </author>
  <url>http://github.com/Kev/sleekmigrate/commit/abaf9215f3bdc8a289b46ea57a24b343280e3771</url>
  <id>abaf9215f3bdc8a289b46ea57a24b343280e3771</id>
  <committed-date>2008-08-01T08:05:30-07:00</committed-date>
  <authored-date>2008-08-01T08:05:30-07:00</authored-date>
  <message>Now saves 'real' XML</message>
  <tree>157bb5c8de3bff278baadc0da435b2cd77dd4364</tree>
  <committer>
    <name>Kevin Smith</name>
    <email>kevin@kismith.co.uk</email>
  </committer>
</commit>
