Classes/Console/Service/XsdGenerator.php
protected function addChildWithCData(\SimpleXMLElement $parentXmlNode, $childNodeName, $childNodeValue)
    {
        $parentDomNode = dom_import_simplexml($parentXmlNode);
        $domDocument = new \DOMDocument();

        $childNode = $domDocument->appendChild($domDocument->createElement($childNodeName));
        $childNode->appendChild($domDocument->createCDATASection($childNodeValue));
        $childNodeTarget = $parentDomNode->ownerDocument->importNode($childNode, true);
        $parentDomNode->appendChild($childNodeTarget);

        return simplexml_import_dom($childNodeTarget);
    }
protected function addChildWithCData(\SimpleXMLElement $parentXmlNode, $childNodeName, $childNodeValue)
    {
        $parentDomNode = dom_import_simplexml($parentXmlNode);
        $domDocument = new \DOMDocument();

        $childNode = $domDocument->appendChild($domDocument->createElement($childNodeName));
        $childNode->appendChild($domDocument->createCDATASection($childNodeValue));
        $childNodeTarget = $parentDomNode->ownerDocument->importNode($childNode, true);
        $parentDomNode->appendChild($childNodeTarget);

        return simplexml_import_dom($childNodeTarget);
    }
Add a child node to $parentXmlNode, and wrap the contents inside a CDATA section.

@param \SimpleXMLElement $parentXmlNode Parent XML Node to add the child to
@param string $childNodeName Name of the child node
@param string $childNodeValue Value of the child node. Will be placed inside CDATA.
@return \SimpleXMLElement the new element