def export_to_xml(self, block, xmlfile):
        """
        Export the block to XML, writing the XML to `xmlfile`.
        """
        root = etree.Element("unknown_root", nsmap=XML_NAMESPACES)
        tree = etree.ElementTree(root)
        block.add_xml_to_node(root)
        # write asides as children
        for aside in self.get_asides(block):
            if aside.needs_serialization():
                aside_node = etree.Element("unknown_root", nsmap=XML_NAMESPACES)
                aside.add_xml_to_node(aside_node)
                block.append(aside_node)
        tree.write(xmlfile, xml_declaration=True, pretty_print=True, encoding='utf-8')
def export_to_xml ( self , block , xmlfile ) : root = etree . Element ( "unknown_root" , nsmap = XML_NAMESPACES ) tree = etree . ElementTree ( root ) block . add_xml_to_node ( root ) for aside in self . get_asides ( block ) : if aside . needs_serialization ( ) : aside_node = etree . Element ( "unknown_root" , nsmap = XML_NAMESPACES ) aside . add_xml_to_node ( aside_node ) block . append ( aside_node ) tree . write ( xmlfile , xml_declaration = True , pretty_print = True , encoding = 'utf-8' )
Export the block to XML, writing the XML to `xmlfile`.