public function getErrors($asFlat = false)
    {
        $iterator = true === $asFlat
            ? $this->getRecursiveIterator()
            : $this;

        $errors = array();
		foreach ($iterator as $element) {
    		if ($element->getType() == self::TYPE_ERROR) {
                $errors[] = $element;
            }
		}
		return $errors;
	}