private static function extract(NodeInterface $node)
    {
        $attributes = [];
        $nodes = [];

        foreach (self::extractProperties($node) as $name => $value) {
            if (is_array($value)) {
                foreach ($value as $item) {
                    if ($item instanceof NodeInterface) {
                        $nodes[$name][] = $item;
                    } else {
                        $attributes[$name][] = $item;
                    }
                }
            } else {
                if ($value instanceof NodeInterface) {
                    $nodes[$name] = $value;
                } else {
                    $attributes[$name] = $value;
                }
            }
        }

        return [$attributes, $nodes];
    }