summaryrefslogtreecommitdiff
path: root/sleekxmpp/xmlstream/stanzabase.py
diff options
context:
space:
mode:
Diffstat (limited to 'sleekxmpp/xmlstream/stanzabase.py')
-rw-r--r--sleekxmpp/xmlstream/stanzabase.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/sleekxmpp/xmlstream/stanzabase.py b/sleekxmpp/xmlstream/stanzabase.py
index 3937a7a9..83d86999 100644
--- a/sleekxmpp/xmlstream/stanzabase.py
+++ b/sleekxmpp/xmlstream/stanzabase.py
@@ -1007,7 +1007,9 @@ class ElementBase(object):
"""
Return a string serialization of the underlying XML object.
"""
- return tostring(self.xml, xmlns='', stanza_ns=self.namespace)
+ return tostring(self.xml, xmlns='',
+ stanza_ns=self.namespace,
+ top_level=True)
def __repr__(self):
"""
@@ -1217,4 +1219,5 @@ class StanzaBase(ElementBase):
"""Serialize the stanza's XML to a string."""
return tostring(self.xml, xmlns='',
stanza_ns=self.namespace,
- stream=self.stream)
+ stream=self.stream,
+ top_level = True)