public function getChildrenByType($type, $recursive = true)
    {
        $results = array();

        foreach ($this->parts as $part) {
            if (is_a($part, $type) || is_subclass_of($part, $type)) {
                $results[] = $part;
            }
            
            if ($recursive) {
                $results = array_merge($results, $part->getChildrenByType($type, $recursive));
            }
        }

        return $results;
    }