'Initialize the stanza\'s XML contents.
Will return ``True`` if XML was generated according to the stanza\'s
definition instead of building a stanza object from an existing
XML object.
:param xml: An existing XML object to use for the stanza\'s content
instead of generating new XML.'

def setup(self, xml=None):

    if (self.xml is None):
        self.xml = xml
    last_xml = self.xml
    if (self.xml is None):
        for ename in self.name.split(u'/'):
            new = ET.Element((u'{%s}%s' % (self.namespace, ename)))
            if (self.xml is None):
                self.xml = new
            else:
                last_xml.append(new)
            last_xml = new
        if (self.parent is not None):
            self.parent().xml.append(self.xml)
        return True
    else:
        return False
