How can I avoid extraneous divs in my form?
The first &lt;div&gt; is hard coded into the theme_form() function, so you can override that in your theme's template.php file if you want to. You should be aware, though, that the wrapping &lt;div&gt; is actually there to ensure XHTML compliance; if you remove it your page will fail validation.

That said, this is the code to do it (replacing MYTHEME with the name of your theme):

function MYTHEME_form($variables) {
  $element = $variables['element'];
  if (isset($element['#action'])) {
    $element['#attributes']['action'] = drupal_strip_dangerous_protocols($element['#action']);
  }
  element_set_attributes($element, array('method', 'id'));
  if (empty($element['#attributes']['accept-charset'])) {
    $element['#attributes']['accept-charset'] = "UTF-8";
  }

  return '&lt;form' . drupal_attributes($element['#attributes']) . '&gt;' . $element['#children'] . '&lt;/form&gt;';
}


The only change from the original function is the removal of the &lt;div&gt; and &lt;/div&gt; from the last line, and the removal of the XHTML compliance comment as that no longer applies.

Overriding the fieldset theme is pretty much the same, except you'll be borrowing the code from theme_fieldset():

function MYTHEME_fieldset($variables) {
  $element = $variables['element'];
  element_set_attributes($element, array('id'));
  _form_set_class($element, array('form-wrapper'));

  $output = '&lt;fieldset' . drupal_attributes($element['#attributes']) . '&gt;';
  if (!empty($element['#title'])) {
    // Always wrap fieldset legends in a SPAN for CSS positioning.
    $output .= '&lt;legend&gt;&lt;span class="fieldset-legend"&gt;' . $element['#title'] . '&lt;/span&gt;&lt;/legend&gt;';
  }

  if (!empty($element['#description'])) {
    $output .= '&lt;div class="fieldset-description"&gt;' . $element['#description'] . '&lt;/div&gt;';
  }
  $output .= $element['#children'];
  if (isset($element['#value'])) {
    $output .= $element['#value'];
  }

  $output .= "&lt;/fieldset&gt;\n";
  return $output;
}


Once you clear Drupal's caches the extraneous markup should just disappear.