/**
  * Returns the Metadata Fieldsets for the given DocumentId
  * @return KTForm 
  *
  */
 function getTypeMetadataFieldsets($iDocumentTypeID)
 {
     //Creating the form
     $oForm = new KTForm();
     $oFReg =& KTFieldsetRegistry::getSingleton();
     $activesets = KTFieldset::getForDocumentType($iDocumentTypeID);
     foreach ($activesets as $oFieldset) {
         $widgets = kt_array_merge($widgets, $oFReg->widgetsForFieldset($oFieldset, 'fieldset_' . $oFieldset->getId(), $this->oDocument));
         $validators = kt_array_merge($validators, $oFReg->validatorsForFieldset($oFieldset, 'fieldset_' . $oFieldset->getId(), $this->oDocument));
     }
     $oForm->setWidgets($widgets);
     $oForm->setValidators($validators);
     return $oForm->renderWidgets();
 }