original_string: protected function make_sure_xml_exists($filename, $rootelement = false, $content = array()) {
  
          $existed = file_exists($this->converter->get_workdir_path().'/'.$filename);
  
          if ($existed) {
              return true;
          }
  
          if ($rootelement !== false) {
              $this->open_xml_writer($filename);
              $this->write_xml($rootelement, $content);
              $this->close_xml_writer();
          }
  
          return false;
      }
code: protected function make_sure_xml_exists($filename, $rootelement = false, $content = array()) {
  
          $existed = file_exists($this->converter->get_workdir_path().'/'.$filename);
  
          if ($existed) {
              return true;
          }
  
          if ($rootelement !== false) {
              $this->open_xml_writer($filename);
              $this->write_xml($rootelement, $content);
              $this->close_xml_writer();
          }
  
          return false;
      }
code_tokens: protected function make_sure_xml_exists ( $ filename , $ rootelement = false , $ content = array ( ) ) { $ existed = file_exists ( $ this -> converter -> get_workdir_path ( ) . '/' . $ filename ) ; if ( $ existed ) { return true ; } if ( $ rootelement !== false ) { $ this -> open_xml_writer ( $ filename ) ; $ this -> write_xml ( $ rootelement , $ content ) ; $ this -> close_xml_writer ( ) ; } return false ; }
docstring: Makes sure that a new XML file exists, or creates it itself
  
  This is here so we can check that all XML files that the restore process relies on have
  been created by an executed handler. If the file is not found, this method can create it
  using the given $rootelement as an empty root container in the file.
  
  @param string $filename relative file name like 'course/course.xml'
  @param string|bool $rootelement root element to use, false to not create the file
  @param array $content content of the root element
  @return bool true is the file existed, false if it did not
docstring_tokens: Makes sure that a new XML file exists or creates it itself