def find_address_of_type(host_elem, type_):
	"""Return the host's address of the given type, or `None` if there
	is no address element of that type.
	"""
	address_elem = host_elem.find('./address[@addrtype="{}"]'.format(type_))
	if address_elem is not None:
		return address_elem.get('addr')