@param \SimpleXMLElement $element

@return array
341493
protected function elementToArray(\SimpleXMLElement $element): array
    {
        $result = [];
        foreach ($element->xpath('*') as $node) {
            if (count($node->xpath('*')) > 0) {
                $value = $this->elementToArray($node);
            } else {
                $value = strval($node);
            }
            $result = array_merge_recursive($result, [$node->getName() => $value]);
        }

        return $result;
    }
849416
protected function parseParameters(SimpleXMLElement $xml)
    {
        if (!$xml->parameters) {
            return;
        }

        $this->container->getParameterBag()->add($this->getArgumentsAsPhp($xml->parameters, 'parameter'));
    }
653613
private function getProperties(\SimpleXMLElement $resource): array
    {
        $properties = [];
        foreach ($resource->property as $property) {
            $properties[(string) $property['name']] = [
                'description' => $this->phpize($property, 'description', 'string'),
                'readable' => $this->phpize($property, 'readable', 'bool'),
                'writable' => $this->phpize($property, 'writable', 'bool'),
                'readableLink' => $this->phpize($property, 'readableLink', 'bool'),
                'writableLink' => $this->phpize($property, 'writableLink', 'bool'),
                'required' => $this->phpize($property, 'required', 'bool'),
                'identifier' => $this->phpize($property, 'identifier', 'bool'),
                'iri' => $this->phpize($property, 'iri', 'string'),
                'attributes' => $this->getAttributes($property, 'attribute'),
                'subresource' => $property->subresource ? [
                    'collection' => $this->phpize($property->subresource, 'collection', 'bool'),
                    'resourceClass' => $this->phpize($property->subresource, 'resourceClass', 'string'),
                    'maxDepth' => $this->phpize($property->subresource, 'maxDepth', 'integer'),
                ] : null,
            ];
        }

        return $properties;
    }
1358256
private static function deserializeLicenseTemplates($xmlElement)
    {
        $result = [];

        foreach ($xmlElement->children() as $child) {
            $result[] = self::deserializePlayReadyLicenseTemplate($child);
        }

        return $result;
    }
120366
public function resolveElement(Element $element)
    {
        $elementtype = $this->elementService->findElementtype($element);

        return $this->resolveElementtype($elementtype);
    }
354579
protected function simpleXmlToArray(SimpleXMLElement $xml) {
		$result = [];
		
		foreach ($xml as $element) {
			$name    = $element->getName();
			$content = get_object_vars($element);
			
			if (isset($content['@attributes'])){
				if (isset($content['@attributes']['value'])) {
					$result[$name] = Std::parseValue($content['@attributes']['value']);
					continue;
				}
				
				unset($content['@attributes']);
			}
			
			if (empty($content)) {
				$result[$name] = Std::parseValue($element);
				continue;
			}
			
			$result[$name] = $this->simpleXmlToArray($element);
		}
		
		return $result;
	}
102415
public function xmlName($element)
    {
        list($ns, $localName) = XmlService::parseClarkNotation($element);
        if (isset($this->namespaceMap[$ns])) {
            $propName = $this->namespaceMap[$ns].':'.$localName;
        } else {
            $propName = $element;
        }

        return '<span title="'.$this->h($element).'">'.$this->h($propName).'</span>';
    }
717501
public function appendChildNode(\SimpleXMLElement $element)
    {
        $target  = dom_import_simplexml($this);
        $insert = $target->ownerDocument->importNode(dom_import_simplexml($element), true);
        $target->appendChild($insert);
    }
733019
protected function parseTables(\SimpleXMLElement $element)
    {
        /** @var \SimpleXMLElement $tableElement */
        foreach ($element as $tableElement) {
            $attributes = $tableElement->attributes();
            
            $tableName = (string) $attributes['table'];
            $tablePhpName = isset($attributes['name']) && !empty((string) $attributes['name'])
                ? (string) $attributes['name']
                : $tableName;
            
            $table = new Table($tableName);
            $table->setName($tablePhpName);
            
            $this->schema->addTable($table);
            $this->parseColumns($tableElement, $table);
            $this->parseRelations($tableElement, $table);
        }
        
        return $this;
    }
1169274
function get($element) {
        $node = $this->findNode($element, $this->root);

        assert($node != null);

        return $node->value();
    }
756815
protected function getEnzymes(\SimpleXMLElement $xml)
    {
        $enzymes = array();

        foreach ($xml->Enzyme as $xmlEnzyme) {
            $enzyme = $this->getEnzyme($xmlEnzyme);

            if (isset($enzyme['id'])) {
                $enzymes[$enzyme['id']] = $enzyme;
                continue;
            }

            $enzymes[] = $enzyme;
        }

        return $enzymes;
    }
1192993
protected function extractNodesFromElement($element)
    {
        $references = array();
        if ($this->isNodeChoiceAttribute($element)) {
            $references = array($this->extractNodeFromChoiceAttribute($element));
        } elseif (is_string($element) && $this->hasInternalLinkBBCode($element)) {
            $references = array_merge($references, $this->extractNodeFromBBCode($element));
        } elseif (is_array($element)) {
            foreach ($element as $item) {
                $references = array_merge($references, $this->extractNodesFromElement($item));
            }
        }
        return $references;
    }
379083
public function convertXml($xml)
    {
        try {
            $xml = Xml::build($xml, ['return' => 'domdocument', 'readFile' => false]);
            // We might not get child nodes if there are nested inline entities.
            if ((int)$xml->childNodes->length > 0) {
                return Xml::toArray($xml);
            }

            return [];
        } catch (XmlException $e) {
            return [];
        }
    }
173474
public static function sources(Element $element)
    {
        $html = '';
        foreach ($element->html() as $attributes) {
            $attributes['srcset'] = is_callable($attributes['srcset'])
                ? $attributes['srcset']($element->image()['src'] ?? '')
                : ($element->image()['src'] ?? '');
            $html                 .= Render::tag('source', $attributes, null, Render::FILTER_NULL);
        }

        $html .= Render::tag('img', $element->image(), null, Render::FILTER_NULL);

        return $html;
    }
1104795
protected function transform(DOMDocument $element)
    {
        foreach ($this->transformers as $transformer) {
            $transformer($element);
        }

        return $element;
    }
1000668
public static function toDOM(BaseElement $element): \DOMDocument
    {
        $doc = new \DOMDocument('1.0', 'utf-8');
        $doc->appendChild($element->toDOM($doc));
        return $doc;
    }
394443
private function getElementData(\SimpleXMLElement $element, array $dataProvider): array
    {
        $type = (string)$element->attributes()['type'];

        $type = ($type !== 'double') ? $type : 'float';

        $data = [
            'name' => (string)$element->attributes()['name'],
            'allownull' => (bool)$element->attributes()['allownull'],
            'default' => (string)$element->attributes()['default'],
            'type' => $this->getVariableType($type),
            'is_collection' => $this->isCollection($type),
            'is_dataprovider' => $this->isDataProvider($type),
            'isCamelCase' => $dataProvider['configs']['convertUnderlines']
        ];

        $singleton = (string)$element->attributes()['singleton'];
        if ($singleton !== '') {
            $data['singleton'] = (string)$element->attributes()['singleton'];
            $data['singleton_type'] = $this->getSingleVariableType($type);
        }

        return $data;
    }