def dict_to_xml_schema(data):
	"""
	Input a dictionary to be converted to xml. There should be only one key at
	the top level. The value must be a dict with (required) `children` key and
	(optional) `attrs` key. This will be called the `sub-element dictionary`.

	The `attrs` value must be a dictionary; each value will be added to the
	element's xml tag as attributes. e.g.:
		{"example": {
			"attrs": {
				"key1": "value1",
				...
			},
			...
		}}

	would result in:
		<example key1="value1" key2="value2"></example>

	If the value is a dict it must contain one or more keys which will be used
	as the sub-element names. Each sub-element must have a value of a sub-element
	dictionary(see above) or a list of sub-element dictionaries.
	If the value is not a dict, it will be the value of the element.
	If the value is a list, multiple elements of the same tag will be created
	from each sub-element dict in the list.

	:param data: dict: Used to create an XML tree. e.g.:
		example_data = {
			"toast": {
				"attrs": {
					"launch": "param",
					"duration": "short",
				},
				"children": {
					"visual": {
						"children": {
							"binding": {
								"attrs": {"template": "ToastText01"},
								"children": {
									"text": [
										{
											"attrs": {"id": "1"},
											"children": "text1",
										},
										{
											"attrs": {"id": "2"},
											"children": "text2",
										},
									],
								},
							},
						},
					},
				},
			},
		}
	:return: ElementTree.Element
	"""
	for key, value in data.items():
		root = _add_element_attrs(ET.Element(key), value.get("attrs", {}))
		children = value.get("children", None)
		if isinstance(children, dict):
			_add_sub_elements_from_dict(root, children)
		return root