Where are the main menu links created?
You can override theme_links__system_main_menu() by declaring a function in your theme's template.php file:

function MYTHEME_links__system_main_menu($vars) {
  $links = $vars['links'];

  $items = array();
  foreach ($links as $link) {
    $items[] = l($link['title'], $link['href']);
  }

  return theme('item_list', array('items' =&gt; $items));
}


The above is a very basic example, you'll probably want to take a look at the original code for theme_links() to make that a bit more bulletproof.