Export the list of all permissions of this category to a SimpleXMLElement instance.

@param \SimpleXMLElement $xml
420483
public static function exportList($xml)
    {
        $categories = PermissionKeyCategory::getList();
        $pxml = $xml->addChild('permissionkeys');
        foreach ($categories as $cat) {
            $permissions = static::getList($cat->getPermissionKeyCategoryHandle());
            foreach ($permissions as $p) {
                $p->export($pxml);
            }
        }
    }
709052
public static function exportList($xml)
    {
        $app = Application::getFacadeApplication();
        $db = $app->make(Connection::class);
        $bxml = $xml->addChild('blocktypesets');
        $rs = $db->executeQuery('select btsID from BlockTypeSets order by btsID asc');
        while (($btsID = $rs->fetchColumn()) !== false) {
            $bts = static::getByID($btsID);
            $bts->export($bxml);
        }
    }
147204
private function loadProperty(\SimpleXMLElement $element)
    {
        $property = [];

        if (isset($element['alias'])) {
            $property['alias'] = (string) $element['alias'];
        }

        if (isset($element['type'])) {
            $property['type'] = (string) $element['type'];
        }

        if (isset($element['exclude'])) {
            $property['exclude'] = (string) $element['exclude'] === 'true';
        }

        if (isset($element['expose'])) {
            $property['expose'] = (string) $element['expose'] === 'true';
        }

        if (isset($element['accessor'])) {
            $property['accessor'] = (string) $element['accessor'];
        }

        if (isset($element['readable'])) {
            $property['readable'] = (string) $element['readable'] === 'true';
        }

        if (isset($element['writable'])) {
            $property['writable'] = (string) $element['writable'] === 'true';
        }

        if (isset($element['mutator'])) {
            $property['mutator'] = (string) $element['mutator'];
        }

        if (isset($element['since'])) {
            $property['since'] = (string) $element['since'];
        }

        if (isset($element['until'])) {
            $property['until'] = (string) $element['until'];
        }

        if (isset($element['max-depth'])) {
            $property['max_depth'] = (int) $element['max-depth'];
        }

        foreach ($element->group as $group) {
            $property['groups'][] = (string) $group;
        }

        if (isset($element['xml-attribute'])) {
            $property['xml_attribute'] = (string) $element['xml-attribute'] === 'true';
        }

        if (isset($element['xml-value'])) {
            $property['xml_value'] = (string) $element['xml-value'] === 'true';
        }

        if (isset($element['xml-inline'])) {
            $property['xml_inline'] = (string) $element['xml-inline'] === 'true';
        }

        if (isset($element['xml-entry'])) {
            $property['xml_entry'] = (string) $element['xml-entry'];
        }

        if (isset($element['xml-entry-attribute'])) {
            $property['xml_entry_attribute'] = (string) $element['xml-entry-attribute'];
        }

        if (isset($element['xml-key-as-attribute'])) {
            $property['xml_key_as_attribute'] = (string) $element['xml-key-as-attribute'] === 'true';
        }

        if (isset($element['xml-key-as-node'])) {
            $property['xml_key_as_node'] = (string) $element['xml-key-as-node'] === 'true';
        }

        return $property;
    }
1277545
protected function parseXML($xml){
        if (!$xml){
            return false;
        }
        
        $this->response = array();
        $this->response['ReportRequestId'] = (string)$xml->ReportRequestId;
        $this->response['ReportType'] = (string)$xml->ReportType;
        $this->response['StartDate'] = (string)$xml->StartDate;
        $this->response['EndDate'] = (string)$xml->EndDate;
        $this->response['Scheduled'] = (string)$xml->Scheduled;
        $this->response['SubmittedDate'] = (string)$xml->SubmittedDate;
        $this->response['ReportProcessingStatus'] = (string)$xml->ReportProcessingStatus;
        
    }
1276236
private function xmlToElements($xml)
    {
        //====================================================================//
        // Convert XML to Object Recursively
        try {
            $result = simplexml_load_string($xml, "SimpleXMLElement", LIBXML_NOERROR);
        } catch (Exception $ex) {
            $this->fault = $ex->getMessage();

            return false;
        }

        return $result;
    }
247557
private function createFieldsElement($xml)
    {
        $fields = $xml->createElement('fields');

        foreach ($this->fields as $f) {
            $fields->appendChild($this->createFieldElement($xml, $f));
        }

        return $fields;
    }
511604
protected function parseXML($xml){
        $this->list = array();
        if (!$xml){
            return false;
        }

        foreach ($xml->SubscriptionList->children() as $x) {
            $temp = array();
            $temp['NotificationType'] = (string)$x->NotificationType;
            $temp['IsEnabled'] = (string)$x->IsEnabled;
            $temp['Destination']['DeliveryChannel'] = (string)$x->Destination->DeliveryChannel;
            foreach ($x->Destination->AttributeList->children() as $z) {
                $temp['Destination']['AttributeList'][(string)$z->Key] = (string)$z->Value;
            }
            $this->list[] = $temp;
        }
    }
547909
private function getXMLLanguageList(SimpleXMLElement $element)
    {
        $this->xml_language_list = new CNabuXMLLanguageList(new CNabuLanguageList());
        $this->xml_language_list->collect($element);
    }
142458
public static function exportList($xml)
    {
        $btl = new static();
        $blocktypes = $btl->get();
        $nxml = $xml->addChild('blocktypes');
        foreach ($blocktypes as $bt) {
            $type = $nxml->addChild('blocktype');
            $type->addAttribute('handle', $bt->getBlockTypeHandle());
            $type->addAttribute('package', $bt->getPackageHandle());
        }
    }
1281710
protected function generateXMLObject($xml)
    {
        try {
            libxml_use_internal_errors(true);
            return new SimpleXMLElement($xml, LIBXML_NOCDATA);
        } catch (\Exception $e) {
            return false;
        }
    }
41424
protected function loadXML($xml)
	{
		$this->checkUnsupported($xml);

		// Activate small nodes allocation and relax LibXML's hardcoded limits if applicable. Limits
		// on tags can be set during configuration
		$flags = (LIBXML_VERSION >= 20700) ? LIBXML_COMPACT | LIBXML_PARSEHUGE : 0;

		$useErrors = libxml_use_internal_errors(true);
		$dom       = new DOMDocument;
		$success   = $dom->loadXML($xml, $flags);
		libxml_use_internal_errors($useErrors);

		if (!$success)
		{
			throw new InvalidArgumentException('Cannot load XML: ' . libxml_get_last_error()->message);
		}

		return $dom;
	}
797386
protected static function parseAtom(\SimpleXMLElement $xml)
    {
        if (!isset($xml->entry)) {
            return false;
        }

        $url = '';

        foreach ($xml->link as $link) {
            $attributes = $link->attributes();

            if (empty($attributes->href) || ((string) $attributes->rel === 'self')) {
                continue;
            }
            $url = (string) $attributes->href;
            break;
        }

        return [
            'url' => $url,
            'items' => self::getAtomEntries($xml->entry),
        ];
    }
233757
public function formatXml($xml)
    {
        $dom = new DOMDocument();
        $dom->formatOutput = true;
        $dom->preserveWhiteSpace = false;
        $dom->loadXml($xml);

        return $dom->saveXml();
    }
27619
public function addXML($xml)
    {
        $next_elem = $this->createDocumentFragment();
        $next_elem->appendXML($xml);
        $this->doc->appendChild($next_elem);

    }
74028
public static function parseResponseIfXml(SimpleXMLElement $xml){
        $returnValue = self::parseElementXml($xml);
        $i = 0;
        $expression = null;
        $responseRules = array();
        foreach($xml->children() as $child){
            if($i){
                $name = $child->getName();
                $methodName = 'parse'.ucfirst($name).'Xml';
                if(method_exists(__CLASS__, $methodName)){
                    $responseRules[] = self::$methodName($child);
                } else{
                    $responseRules[] = self::parseResponseRuleXml($child);
                }
            }else{
                //the first child is the expression
                $expression = self::parseExpressionXml($child);
            }
            $i++;
        }
        $returnValue['expression'] = $expression;
        $returnValue['responseRules'] = $responseRules;
        return $returnValue;
    }
717501
public function appendChildNode(\SimpleXMLElement $element)
    {
        $target  = dom_import_simplexml($this);
        $insert = $target->ownerDocument->importNode(dom_import_simplexml($element), true);
        $target->appendChild($insert);
    }
1060780
public function writeXml($xml)
    {
        if ($this->writeObjectReference($xml)) {
            return $this;
        }

        if(is_string($xml)) {
            //nothing to do
        } else if ($xml instanceof DOMDocument) {
            $xml = $xml->saveXml();
        } else if ($xml instanceof SimpleXMLElement) {
            $xml = $xml->asXML();
        } else {
            require_once 'Zend/Amf/Exception.php';
            throw new Zend_Amf_Exception('Invalid xml specified; must be a DOMDocument or SimpleXMLElement');
        }

        $this->writeBinaryString($xml);

        return $this;
    }