function toXML(&$writer)
 {
     if ($this->getMetaDataScheme()) {
         $attr['MetadataScheme'] = $this->getMetaDataScheme();
     }
     if ($this->getLanguageCode()) {
         $attr['Language'] = $this->getLanguageCode();
     }
     $writer->xmlStartTag('Meta-Metadata', $attr ? $attr : null);
     // ELEMENT IDENTIFIER
     $identifiers = $this->getIdentifierIds();
     foreach ($identifiers as $id) {
         $ide =& $this->getIdentifier($id);
         $ide->toXML($writer);
     }
     if (!count($identifiers)) {
         include_once 'Services/Metadata/classes/class.ilMDIdentifier.php';
         $ide = new ilMDIdentifier($this->getRBACId(), $this->getObjId());
         $ide->toXML($writer);
     }
     // ELEMETN Contribute
     $contributes = $this->getContributeIds();
     foreach ($contributes as $id) {
         $con =& $this->getContribute($id);
         $con->toXML($writer);
     }
     if (!count($contributes)) {
         include_once 'Services/MetaData/classes/class.ilMDContribute.php';
         $con = new ilMDContribute($this->getRBACId(), $this->getObjId());
         $con->toXML($writer);
     }
     $writer->xmlEndTag('Meta-Metadata');
 }
 function toXML(&$writer)
 {
     $writer->xmlStartTag('Lifecycle', array('Status' => $this->getStatus() ? $this->getStatus() : 'Draft'));
     $writer->xmlElement('Version', array('Language' => $this->getVersionLanguageCode() ? $this->getVersionLanguageCode() : 'en'), $this->getVersion());
     // contribute
     $contributes = $this->getContributeIds();
     foreach ($contributes as $id) {
         $con =& $this->getContribute($id);
         $con->toXML($writer);
     }
     if (!count($contributes)) {
         include_once 'Services/MetaData/classes/class.ilMDContribute.php';
         $con = new ilMDContribute($this->getRBACId(), $this->getObjId());
         $con->toXML($writer);
     }
     $writer->xmlEndTag('Lifecycle');
 }