private function addAggregate($dom, $elem)
    {
        if(!empty($this->aggregate)) {
            $aggregateElem = $dom->createElement('aggregate');
            $aggregateElem->setAttribute('apply', $this->aggregate);
            $elem->appendChild($aggregateElem);
        }
        return $elem;
    }