code: def set_address(network, address):
      
      if network.find('.//ip') is not None:
          raise RuntimeError("Address already specified in XML configuration.")
  
      netmask = str(address.netmask)
      ipv4 = str(address[1])
      dhcp_start = str(address[2])
      dhcp_end = str(address[-2])
      ip = etree.SubElement(network, 'ip', address=ipv4, netmask=netmask)
      dhcp = etree.SubElement(ip, 'dhcp')
  
      etree.SubElement(dhcp, 'range', start=dhcp_start, end=dhcp_end)
docs: Sets the given address to the network XML element.
  
      Libvirt bridge will have address and DHCP server configured
      according to the subnet prefix length.