/**
  * Build and save command objects from XML array.
  *
  * @param $body XML array of BODY element.
  */
 function process_body($body)
 {
     if (isset($body['FINAL'][0])) {
         $this->commands[] = new syncml_command_final();
     }
     if (isset($body['STATUS']) && is_array($body['STATUS'])) {
         for ($i = 0; array_key_exists($i, $body['STATUS']); $i++) {
             $this->commands[] = new syncml_command_status($body['STATUS'][$i]);
         }
     }
     if (isset($body[SYNCML_XML_ORIGINAL_ORDER]) && is_array($body[SYNCML_XML_ORIGINAL_ORDER])) {
         foreach ($body[SYNCML_XML_ORIGINAL_ORDER] as $command) {
             $command_obj = syncml_command::build($command);
             if ($command_obj) {
                 $this->commands[] = $command_obj;
             }
         }
     }
 }