write xml file using lxml library in python,"str = etree.tostring(root, pretty_print=True)"