public function fromArray($array, $rootKey = 'data', $charset = null)
    {
        $rootNode = $this->getRootNode($rootKey);
        $this->arrayToDOM($array, $rootNode, $charset, false);

        return $rootNode->ownerDocument->saveXML();
    }
public function fromArray($array, $rootKey = 'data', $charset = null)
    {
        $rootNode = $this->getRootNode($rootKey);
        $this->arrayToDOM($array, $rootNode, $charset, false);

        return $rootNode->ownerDocument->saveXML();
    }
public function fromArray ( $ array , $ rootKey = 'data' , $ charset = null ) { $ rootNode = $ this -> getRootNode ( $ rootKey ) ; $ this -> arrayToDOM ( $ array , $ rootNode , $ charset , false ) ; return $ rootNode -> ownerDocument -> saveXML ( ) ; }
Converts data from an associative array to XML.

@param array $array Source data to convert
@param string $rootKey Will be used for naming the root node
@param string $charset Character set of the input data. Defaults to UTF-8.

@return string Converted data, as an XML string
Converts data from an associative array to XML .