aboutsummaryrefslogtreecommitdiffstats
path: root/gsxws/core.py
diff options
context:
space:
mode:
Diffstat (limited to 'gsxws/core.py')
-rw-r--r--gsxws/core.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/gsxws/core.py b/gsxws/core.py
index 59f23dd..c8f9cec 100644
--- a/gsxws/core.py
+++ b/gsxws/core.py
@@ -336,15 +336,17 @@ class GsxObject(object):
"""
root = ET.Element(root)
for k, v in self._data.items():
- el = ET.SubElement(root, k)
- if isinstance(v, basestring):
- el.text = v
- if isinstance(v, GsxObject):
- el.append(v.to_xml(k))
if isinstance(v, list):
for e in v:
if isinstance(e, GsxObject):
- el.append(e.to_xml(k))
+ i = ET.SubElement(root, k)
+ i.extend(e.to_xml(k))
+ else:
+ el = ET.SubElement(root, k)
+ if isinstance(v, basestring):
+ el.text = v
+ if isinstance(v, GsxObject):
+ el.extend(v.to_xml(k))
return root