• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/classes/general/xml.php
  • Класс: CDataXMLNode
  • Вызов: CDataXMLNode::toSimpleArray
public function toSimpleArray()
{
	if (!empty($this->children))
	{
		$ar = [];
		foreach ($this->children as $child)
		{
			$ar[$child->name][] = $child->toSimpleArray();
		}

		// simplify the array
		foreach ($ar as $name => $value)
		{
			if (count($value) == 1)
			{
				$ar[$name] = $value[0];
			}
		}
		return $ar;
	}

	return $this->content;
}