public function setIndent($spacesNum)
    {
        if ($spacesNum) {
            $this->writer->setIndent(true);
            $this->writer->setIndentString(str_repeat(' ', (int)$spacesNum));
        } else {
            $this->writer->setIndent(false);
        }
        return $this;
    }