original_string: protected function _convertArrayDataToXml(
          $value,
          $addCdata,
          Xml $xml,
          $key,
          $parent,
          array $attributes
      ) {
          $count      = count($value) === 1;
          $isNotEmpty = !empty($attributes);
          $exist      = array_key_exists(0, $value);
  
          if ($count && $isNotEmpty && $exist) {
              $children = $this->_appendDataToNode(
                  $addCdata,
                  $xml,
                  $key,
                  $value[0]
              );
          } else {
              $children = $xml->createElement(
                  $this->_integerToStringKey($key)
              );
              $this->_arrayToXml($value, $xml, $addCdata, $children);
          }
          $parent->appendChild($children);
  
          foreach ($attributes as $attributeKey => $attributeValue) {
              $children->setAttribute($attributeKey, $attributeValue);
          }
  
          return $parent;
      }
code: protected function _convertArrayDataToXml(
          $value,
          $addCdata,
          Xml $xml,
          $key,
          $parent,
          array $attributes
      ) {
          $count      = count($value) === 1;
          $isNotEmpty = !empty($attributes);
          $exist      = array_key_exists(0, $value);
  
          if ($count && $isNotEmpty && $exist) {
              $children = $this->_appendDataToNode(
                  $addCdata,
                  $xml,
                  $key,
                  $value[0]
              );
          } else {
              $children = $xml->createElement(
                  $this->_integerToStringKey($key)
              );
              $this->_arrayToXml($value, $xml, $addCdata, $children);
          }
          $parent->appendChild($children);
  
          foreach ($attributes as $attributeKey => $attributeValue) {
              $children->setAttribute($attributeKey, $attributeValue);
          }
  
          return $parent;
      }
code_tokens: protected function _convertArrayDataToXml ( $ value , $ addCdata , Xml $ xml , $ key , $ parent , array $ attributes ) { $ count = count ( $ value ) === 1 ; $ isNotEmpty = ! empty ( $ attributes ) ; $ exist = array_key_exists ( 0 , $ value ) ; if ( $ count && $ isNotEmpty && $ exist ) { $ children = $ this -> _appendDataToNode ( $ addCdata , $ xml , $ key , $ value [ 0 ] ) ; } else { $ children = $ xml -> createElement ( $ this -> _integerToStringKey ( $ key ) ) ; $ this -> _arrayToXml ( $ value , $ xml , $ addCdata , $ children ) ; } $ parent -> appendChild ( $ children ) ; foreach ( $ attributes as $ attributeKey => $ attributeValue ) { $ children -> setAttribute ( $ attributeKey , $ attributeValue ) ; } return $ parent ; }
docstring: convert array DATA value to xml format and return as xml object
  
  @param array|string $value
  @param string $addCdata
  @param Xml $xml
  @param string|integer $key
  @param DOMElement $parent
  @param array $attributes
  @return DOMElement
docstring_tokens: convert array DATA value to xml format and return as xml object