crowdin: Replace minidom with lxml.etree

* We use lxml already in other places, so thats just commonisation
* It was still marked as "TODO", so get it done

Change-Id: Ie53c67ec01abff0e42f7250b799bc90b5ea4239b
diff --git a/crowdin_sync.py b/crowdin_sync.py
index 7111033..ba4a5fc 100755
--- a/crowdin_sync.py
+++ b/crowdin_sync.py
@@ -36,7 +36,6 @@
 
 from lxml import etree
 from signal import signal, SIGINT
-from xml.dom import minidom
 
 # ################################# GLOBALS ################################## #
 
@@ -372,13 +371,12 @@
 
 def load_xml(x):
     try:
-        return minidom.parse(x)
-    except IOError:
-        print('You have no %s.' % x, file=sys.stderr)
+        return etree.parse(x)
+    except etree.XMLSyntaxError:
+        print('Malformed %s.' % x, file=sys.stderr)
         return None
     except Exception:
-        # TODO: minidom should not be used.
-        print('Malformed %s.' % x, file=sys.stderr)
+        print('You have no %s.' % x, file=sys.stderr)
         return None
 
 
@@ -473,7 +471,7 @@
             paths.append(p.replace('/%s' % branch, ''))
 
     print('\nUploading translations to Gerrit')
-    items = [x for sub in xml for x in sub.getElementsByTagName('project')]
+    items = [x for xmlfile in xml for x in xmlfile.findall("//project")]
     all_projects = []
 
     for path in paths:
@@ -517,7 +515,7 @@
         resultPath = None
         resultProject = None
         for project in items:
-            path = project.attributes['path'].value
+            path = project.get('path')
             if not (result + '/').startswith(path +'/'):
                 continue
             # We want the longest match, so projects in subfolders of other projects are also
@@ -536,10 +534,10 @@
             result = resultPath
             all_projects.append(result)
 
-        br = resultProject.getAttribute('revision') or branch
+        br = resultProject.get('revision') or branch
 
         push_as_commit(files, base_path, result,
-                       resultProject.getAttribute('name'), br, username)
+                       resultProject.get('name'), br, username)
 
 
 def sig_handler(signal_received, frame):