@apply_to_binary_file
def xmlminify(data):
 parser = lxml.etree.XMLParser(remove_blank_text=True)
 newdata = lxml.etree.XML(data, parser=parser)
 return lxml.etree.tostring(newdata, encoding='utf-8', method='xml', xml_declaration=True)

@ apply_to_binary_file def xmlminify ( data ) : parser = lxml . etree . XMLParser ( remove_blank_text = True ) newdata = lxml . etree . XML ( data , parser = parser ) return lxml . etree . tostring ( newdata , encoding = 'utf-8' , method = 'xml' , xml_declaration = True )
minify xml files .