def render(self,encoding=None,fragment=False,pretty=False,nsmap=None):
        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
Do any work necessary to prepare a JID, including sending a custom id
dataset/ETHPy150Open rfk/dexml/dexml/__init__.py/Model.render--crossover with--dataset/ETHPy150Open saltstack/salt/salt/returners/mysql.py/prep_jid