def _add_element_attrs(elem, attrs):
	"""
	Add attributes to the given element.

	:param elem: ElementTree.Element: The element the attributes are being added to.
	:param attrs: dict: A dictionary of attributes. e.g.:
		{"attribute1": "value", "attribute2": "another"}
	:return: ElementTree.Element
	"""
	for attr, value in list(attrs.items()):
		elem.attrib[attr] = value
	return elem