protected function appendValueToElementToSend($value, \DOMElement $element)
    {
        if ($value instanceof Element) {
            $this->appendElementToElementToSend($value, $element);
        } elseif (is_array($value)) {
            $this->appendValuesToElementToSend($value, $element);
        } elseif (!empty($value)) {
            $element->appendChild(self::getDom()->createTextNode($value));
        }

        return $this;
    }
protected function appendValueToElementToSend($value, \DOMElement $element)
    {
        if ($value instanceof Element) {
            $this->appendElementToElementToSend($value, $element);
        } elseif (is_array($value)) {
            $this->appendValuesToElementToSend($value, $element);
        } elseif (!empty($value)) {
            $element->appendChild(self::getDom()->createTextNode($value));
        }

        return $this;
    }
protected function appendValueToElementToSend ( $ value , \ DOMElement $ element ) { if ( $ value instanceof Element ) { $ this -> appendElementToElementToSend ( $ value , $ element ) ; } elseif ( is_array ( $ value ) ) { $ this -> appendValuesToElementToSend ( $ value , $ element ) ; } elseif ( ! empty ( $ value ) ) { $ element -> appendChild ( self :: getDom ( ) -> createTextNode ( $ value ) ) ; } return $ this ; }
Handle adding value to element according to the value type.

@param mixed       $value
@param \DOMElement $element

@return Element
Handle adding value to element according to the value type .