'Write out element for comparison.'

def _writeElement(self, element, encoding='us-ascii', compression=0):

    ElementTree = self.etree.ElementTree
    f = BytesIO()
    tree = ElementTree(element=element)
    tree.write(f, encoding=encoding, compression=compression)
    data = f.getvalue()
    if compression:
        data = zlib.decompress(data)
    return canonicalize(data)
