def dict_to_xml(spec, full_document=False):
middle = xmltodict.unparse(spec, full_document=full_document, pretty=True)<EOL>return lxml.etree.fromstring(middle)<EOL>
Convert dict to XML

Args:
    spec(dict): dict to convert
    full_document(bool): whether to add XML headers

Returns:
    lxml.etree.Element: XML tree