How do I add divs to a sitemap? I have the Sitemap module installed and it creates an unordered list of my chosen menu's items.

Main Menu looks like this:

Home
 - submenuitem1
 - submenuitem2
 - submenuitemn

Services
 - submenuitem1
 - submenuitem2
 - submenuitemn

References
 - submenuitem1
 - submenuitem2
 - submenuitemn

Links
 - submenuitem1
 - submenuitem2
 - submenuitemn

How can I add DIVs to each main menu item with its subitems ( Home+subemenuitems, Service+submenuitems etc.) ?

I managed to override site_map_menu_link to give it some depth at least.

function MYTHEME_site_map_menu_link(array $variables) {
    $element = $variables['element'];
    $sub_menu = '';

    $element['#attributes']['class'][] = 'menu-' . $element['#original_link']['plid'];
    $menu_id = 'menu-' . $element['#original_link']['plid'];
    $link_depth = 'depth-'. $element['#original_link']['depth'];

    if ($element['#below']) {
      $sub_menu = drupal_render($element['#below']);
    }

    $output = l($element['#title'], $element['#href'], $element['#localized_options']);
    return '&lt;div class="'.$menu_id." ".$link_depth.'"&gt;&lt;li&gt;' . $output . $sub_menu . "&lt;/li&gt;\n&lt;/div&gt;";
}
You can use theme_site_map_box in your template.php!

I've done something similar before where I've changed the H2's to H3's:

Try something like the following in your template.php

function MYTHEME_site_map_box($variables) {
  $title = $variables['title'];
  $content = $variables['content'];
  $attributes = $variables['attributes'];

  $output = '';
  if (!empty($title) || !empty($content)) {
    $output .= '&lt;div' . drupal_attributes($attributes) . '&gt;';
    if (!empty($title)) {
      $output .= '&lt;h3 class="title"&gt;' . $title . '&lt;/h3&gt;';
    }
    if (!empty($content)) {
      $output .= '&lt;div class="content"&gt;&lt;div class="MYCLASS"&gt;' . $content . '&lt;/div&gt;&lt;/div&gt;';
    }
    $output .= '&lt;/div&gt;';
  }

  return $output;
}


I can't remember off the top of my head the structure of $content, but the above code should put an extra div around each section of the site map with the class of MYCLASS.

API Docs: theme_site_map_box()