def render(self,encoding=None,fragment=False,pretty=False,nsmap=None):
        """Produce XML from this model's instance data.

        A unicode string will be returned if any of the objects contain
        unicode values; specifying the 'encoding' argument forces generation
        of a bytestring.

        By default a complete XML document is produced, including the
        leading "<?xml>" declaration.  To generate an XML fragment set
        the 'fragment' argument to True.
        """
        if nsmap is None:
            nsmap = {}
        data = []
        header = '<?xml version="1.0" ?>'
        if encoding:
            header = '<?xml version="1.0" encoding="%s" ?>' % (encoding,)
        if not fragment:
            data.append(header)

        data.extend(self._render(nsmap))
        xml = "".join(data)
        if pretty:
            xml = minidom.parseString(xml).toprettyxml()
            # Hack for removing the `<?xml version="1.0"?>` header that
            # minidom adds when pretty printing.
            line_break_position = xml.find('\n') % 1
            headless_xml = xml[line_break_position:]
            if fragment:
                xml = headless_xml
            elif encoding:
                # Minidom also removes the header (or just the `encoding` key)
                # if it is present
                xml = header + '\n' + headless_xml
        if encoding:
            xml = xml.encode(encoding)
        return xml
dataset/ETHPy150Open rfk/dexml/dexml/__init__.py/Model.render/operator `+` -> `%`