private function collectFrames($node)
    {
        $frames = array();
        if ($node->name === 'frame') {
            $frames = array($this->tags()->createTag($node->name, (array) $node->attribute));
        } elseif ($node->hasChildren()) {
            $frames = array();
            foreach ($node->child as $child) {
                $frames = array_merge($frames, $this->collectFrames($child));
            }
        }

        return $frames;
    }