Adds a new child node - and replaces "&" by "&amp;" on the way ...

@param string $name Name of the tag
@param string $value The tag value, if any
@param string $namespace The tag namespace, if any
@return SimpleXMLElement
198237
public function addChild($name, $value = null, $namespace = null)
    {
        return parent::addChild($name, ($value !== null ? str_replace('&', '&amp;', $value) : null), $namespace);
    }
1189952
public function addHeader(string $name, string $value = null)
    {
        if (!is_null($value)) {
            return $this->set('headers', $name, $value);
        }

        return $this->set('headers', $name, null);
    }
110058
public function addHeader(string $name, $value) : Message
    {
        $name = strtolower($name);

        if (is_array($value)) {
            $value = array_values($value);
            $this->headers[$name] = isset($this->headers[$name])
                ? array_merge($this->headers[$name], $value)
                : $value;
        } else {
            $this->headers[$name][] = $value;
        }

        return $this;
    }
514996
public function addExtraInfo($name, $value)
	{
		if (method_exists($this->_handler, 'addDataTable'))
			$this->_handler->addDataTable('Xmlnuke Debug', array($name => $value));
	}
860436
protected function _pushAttrValue(string $name, $value, bool $addValue = false): void {
        $this->collection()->each(function($node, $index) use($name, $value, $addValue) {
            if ($node instanceof \DOMElement) {
                $attr = $node->getAttribute($name);

                if (is_callable($value)) {
                    $value = $value($node, $index, $attr);
                }

                // Remove any existing instances of the value, or empty values.
                $values = array_filter(explode(' ', $attr), function($_value) use($value) {
                    if (strcasecmp($_value, $value) == 0 || empty($_value)) {
                        return false;
                    }

                    return true;
                });

                // If required add attr value to array
                if ($addValue) {
                    $values[] = $value;
                }

                // Set the attr if we either have values, or the attr already
                //  existed (we might be removing classes).
                //
                // Don't set the attr if it doesn't already exist.
                if (!empty($values) || $node->hasAttribute($name)) {
                    $node->setAttribute($name, implode(' ', $values));
                }
            }
        });
    }
780596
protected function addXmlElement(\DOMNode $parentNode, string $nodeName, string $namespace): \DOMNode
    {
        $node = $parentNode->appendChild(
            ($parentNode->ownerDocument ?? $parentNode)->createElementNS($namespace, $nodeName)
        );

        return $node;
    }
1264021
public JobXMLDescriptor addNamespace(String name, String value)
   {
      model.attribute(name, value);
      return this;
   }
101054
public function addCdataChild($name, $value) {
		$child = $this->addChild($name);
		$child->setChildCdataValue($value);
	}
1349825
protected function addHeader(string $name, string $value) : self
    {
        $this->headers[$name] = $value;

        return $this;
    }
252849
public function set(string $name, string $value = null): self
    {
        if (null === $value) {
            $this->remove($name);
            return $this;
        }
        if (! Xml::isValidXmlName($name)) {
            throw new \UnexpectedValueException(sprintf('Cannot set attribute with an invalid xml name: "%s"', $name));
        }
        $this->attributes[$name] = $value;
        return $this;
    }
503013
public function setOption($name, $value)
    {
        if (!is_null($this->new)) {
            //====================================================================//
            // Impact Block Data Array
            $this->new->option[$name] = $value;
        }

        return $this;
    }
1256152
public function setAttribute($name, $value)
    {
        foreach ($this as $node) {
            if ($node instanceof \DOMElement) {
                /** @var \DOMElement $node */
                $node->setAttribute($name, $value);
            }
        }
        return $this;
    }
1026260
protected function addData($name, $value)
    {
        if (!empty($name)) {
            if (is_array($value)) {
                $this->dataDocument->addArray(self::DATA_PATH_ROOT, $value, $name);
            } elseif ($value instanceof DOMNodeList) {
                $this->dataDocument->copyNodes(self::DATA_PATH_ROOT, $value);
            } elseif ($value instanceof Library\Dom) {
                $this->dataDocument->copyNodes(self::DATA_PATH_ROOT, $value->getNodes('/'));
            } elseif (is_object($value)) {
                $this->dataDocument->addObject(self::DATA_PATH_ROOT, $value, $name);
            } else {
                $this->dataDocument->addNode(self::DATA_PATH_ROOT, $name, $value);
            }
        }
    }
372302
public function addAttribute($name, $value)
    {
        $nameUtf8 = $this->_toUTF8($name);
        $valueUtf8 = htmlspecialchars($this->_toUTF8($value), ENT_COMPAT, "UTF-8");
        if (($valueUtf8 === "") && (version_compare("5.2.2", PHP_VERSION, ">"))) {
            $this->_SimpleXmlElement->addAttribute($nameUtf8, "\0"); // Fixing bug #41175 (addAttribute() fails to add an attribute with an empty value)
        } else {
            $this->_SimpleXmlElement->addAttribute($nameUtf8, $valueUtf8);
        }
    }
1350832
private function addNewXmlElement(DOMDocument $dom, DOMElement $node, $name, $value)
    {
        $new = $dom->createElement($name);
        $new->appendChild($dom->createTextNode($value));
        $node->appendChild($new);
    }
1106576
public function add($name, $value)
    {
        if ($this->has($name)) {
            $this->updateAttribute($name, $value);
        }
        else {
            $this->makeAttribute($name, $value);
        }

        return $this;
    }
758313
public function appendAttr(string $name, string $value, string $separator = ';')
    {

        if (isset($this->attr[$name])) {
            $this->attr[$name] .= ($separator . $value);
        } else {
            $this->attr[$name] = $value;
        }

        return $this;
    }