protected function addFragmentScope($dom, $elem)
    {
        if (!empty($this->fragmentScope)) {
            $fragScopeElem = $dom->createElement('fragment-scope');
            $fragScopeElem->nodeValue = $this->fragmentScope;
            $elem->appendChild($fragScopeElem);
        }
        return $elem;
    }