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 753977c1..4f1189fd 100644
--- a/sleekxmpp/xmlstream/stanzabase.py
+++ b/sleekxmpp/xmlstream/stanzabase.py
@@ -995,7 +995,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):
"""
@@ -1200,7 +1202,8 @@ 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)
# To comply with PEP8, method names now use underscores.