protected function getNode(\DOMElement $node)
{
$result = [$node->nodeName];
$attributes = array_merge($this->getNamespaces($node), $this->getAttributes($node));
if (!empty($attributes)) {
$result[] = $attributes;
}
foreach ($node->childNodes as $childNode) {
if ($childNode instanceof \DOMElement) {
$result[] = $this->getNode($childNode);
} elseif ($childNode instanceof \DOMText || $childNode instanceof \DOMCdataSection) {
$result[] = $this->getValue($childNode->data);
}
}
return $result;
}