def c14n(xml):
    '''
    Applies c14n to the xml input
    @param xml: str
    @return: str
    '''
    tree = etree.parse(StringIO(xml))
    output = StringIO()
    tree.write_c14n(output, exclusive=False, with_comments=True, compression=0)
    output.flush()
    c14nized = output.getvalue()
    output.close()
    return c14nized
def c14n ( xml ) : tree = etree . parse ( StringIO ( xml ) ) output = StringIO ( ) tree . write_c14n ( output , exclusive = False , with_comments = True , compression = 0 ) output . flush ( ) c14nized = output . getvalue ( ) output . close ( ) return c14nized
Applies c14n to the xml input
    @param xml: str
    @return: str