public function getValuesAsElem($dom)
    {
        $valsElem = $dom->createElement('values');
        $valsElem->setAttribute('name', $this->name);

        switch ($this->type) {
            case 'range':
                $rangeElem = $dom->createElement('range');
                $rangeElem->setAttribute('type', $this->datatype);
                $elemElem = $dom->createElement('element');
                $elemElem->setAttribute('ns', $this->ns);
                $elemElem->setAttribute('name', $this->elem);
                $rangeElem->appendChild($elemElem);
                if($this->attr) {
                    $attrElem = $dom->createElement('attribute');
                    $attrElem->setAttribute('ns', $this->attrNs);
                    $attrElem->setAttribute('name', $this->attr);
                    $rangeElem->appendChild($attrElem);
                }
                $valsElem->appendChild($rangeElem);
                break;
                /* <values name='example'>
                    <range type='xs:integer'>
                        <element ns='' name='game'/>
                        <attribute ns='' name='runs'/>
                    </range>
                    <aggregate apply='sum'/>
                </values> */
            case 'uri':
                $uriElem = $dom->createElement('uri');
                $valsElem->appendChild($uriElem);

                break;
               /* <values name='uri'>
                      <uri/>
                      <values-option>limit=10</values-option>
                    </values> */
            case 'collection':
                $collectionElem = $dom->createElement('collection');
                $valsElem->appendChild($collectionElem);
                break;
               /* <values name="coll">
                      <collection/>
                      <values-option>limit=10</values-option>
                    </values> */
        }
        $this->addAggregate($dom, $valsElem);
        $this->addValuesOptions($dom, $valsElem);
        return $valsElem;
    }