docs: def get_etree_layout_as_dict(layout_tree):
      """
      Convert something that looks like this:
      <layout>
          <item>
              <name>color</name>
              <value>red</value>
          </item>
          <item>
              <name>shapefile</name>
              <value>blah.shp</value>
          </item>
      </layout>
      Into something that looks like this:
      {
          'color' : ['red'],
          'shapefile' : ['blah.shp']
      }
      """
      layout_dict = dict()
  
      for item in layout_tree.findall('item'):
          name  = item.find('name').text
          val_element = item.find('value')
          value = val_element.text.strip()
          if value == '':
              children = val_element.getchildren()
              value = etree.tostring(children[0], pretty_print=True, encoding="unicode")
          layout_dict[name] = value
      return layout_dict