original_string: public function xml(SimpleXMLElement $parent)
      {
          $option = $parent->addChild('option');
          $option->addAttribute('name', '--' . $this->_name);
          $short = '';
          if (strlen($this->_short) > 0) {
              $short = '-' . $this->_short;
          }
          $option->addAttribute('short', $short);
          $option->addAttribute('help', $this->_help);
          $option->addAttribute('boolean', (int)$this->_boolean);
          $option->addChild('default', $this->_default);
          $choices = $option->addChild('choices');
          foreach ($this->_choices as $valid) {
              $choices->addChild('choice', $valid);
          }
  
          return $parent;
      }
code: public function xml(SimpleXMLElement $parent)
      {
          $option = $parent->addChild('option');
          $option->addAttribute('name', '--' . $this->_name);
          $short = '';
          if (strlen($this->_short) > 0) {
              $short = '-' . $this->_short;
          }
          $option->addAttribute('short', $short);
          $option->addAttribute('help', $this->_help);
          $option->addAttribute('boolean', (int)$this->_boolean);
          $option->addChild('default', $this->_default);
          $choices = $option->addChild('choices');
          foreach ($this->_choices as $valid) {
              $choices->addChild('choice', $valid);
          }
  
          return $parent;
      }
code_tokens: public function xml ( SimpleXMLElement $ parent ) { $ option = $ parent -> addChild ( 'option' ) ; $ option -> addAttribute ( 'name' , '--' . $ this -> _name ) ; $ short = '' ; if ( strlen ( $ this -> _short ) > 0 ) { $ short = '-' . $ this -> _short ; } $ option -> addAttribute ( 'short' , $ short ) ; $ option -> addAttribute ( 'help' , $ this -> _help ) ; $ option -> addAttribute ( 'boolean' , ( int ) $ this -> _boolean ) ; $ option -> addChild ( 'default' , $ this -> _default ) ; $ choices = $ option -> addChild ( 'choices' ) ; foreach ( $ this -> _choices as $ valid ) { $ choices -> addChild ( 'choice' , $ valid ) ; } return $ parent ; }
docstring: Append the option's xml into the parent.
  
  @param \SimpleXMLElement $parent The parent element.
  @return \SimpleXMLElement The parent with this option appended.
docstring_tokens: Append the option s xml into the parent .