public function addOptionXML($root, $name, $xmlString)
    {
        if (isset($xmlString)) {
            $elem = $this->dom->createElement($name);
            $xmlDoc = new \DOMDocument();
            $xmlDoc->loadXML($xmlString);
            // http://stackoverflow.com/questions/5783716/php-xml-dom-uncaught-exception-domexception-with-message-wrong-document-error
            $elem->appendChild($this->dom->importNode($xmlDoc->documentElement, true));
            $root->appendChild($elem);
        }
    }
public function addOptionXML($root, $name, $xmlString)
    {
        if (isset($xmlString)) {
            $elem = $this->dom->createElement($name);
            $xmlDoc = new \DOMDocument();
            $xmlDoc->loadXML($xmlString);
            // http://stackoverflow.com/questions/5783716/php-xml-dom-uncaught-exception-domexception-with-message-wrong-document-error
            $elem->appendChild($this->dom->importNode($xmlDoc->documentElement, true));
            $root->appendChild($elem);
        }
    }
public function addOptionXML ( $ root , $ name , $ xmlString ) { if ( isset ( $ xmlString ) ) { $ elem = $ this -> dom -> createElement ( $ name ) ; $ xmlDoc = new \ DOMDocument ( ) ; $ xmlDoc -> loadXML ( $ xmlString ) ; // http://stackoverflow.com/questions/5783716/php-xml-dom-uncaught-exception-domexception-with-message-wrong-document-error $ elem -> appendChild ( $ this -> dom -> importNode ( $ xmlDoc -> documentElement , true ) ) ; $ root -> appendChild ( $ elem ) ; } }
If an option value is set, create a DOM element with an option name
and XML string value and append it to the root element of the options node.

@param DOMElement $root The root element of the options node.
@param string $name The element name (option name).
@param string $value The node value as an XML string.
If an option value is set create a DOM element with an option name and XML string value and append it to the root element of the options node .