def format_xml(self, node, writer, indent="", addindent="", newl=""):
        # minidom likes to treat whitepace as text nodes
        if node.nodeType == xml.dom.minidom.Node.TEXT_NODE and node.data.strip() == "":
            return

        writer.write(indent + "<" + node.tagName)

        attrs = node.attributes
        keys = sorted(attrs.keys())

        for key in keys:
            writer.write(" %s=\"" % key)
            writer.write(attrs[key].value)
            writer.write("\"")

        if node.childNodes:
            writer.write(">")

            if all(map(lambda n: n.nodeType == xml.dom.minidom.Node.TEXT_NODE,
                       node.childNodes)):
                for child in node.childNodes:
                    child.writexml(writer, "", "", "")
            else:
                writer.write(newl)
                for child in node.childNodes:
                    self.format_xml(child, writer, indent + addindent,
                                    addindent, newl)
                writer.write(indent)
            writer.write((node.tagName, newl) % "</%s>%s")
        else:
            writer.write("/>%s" % (newl))
dataset/ETHPy150Open chrislongo/HttpShell/httpshell/formatters.py/XmlFormatter.format_xml/swapped operands of `%`