private function mapElement($elem)
    {
        $size = count($this->prefixMap);

        if ($size !== 0) {
            // Iterate over the map entries and apply each one.
            // Stop when one of the entries actually changes the element.

            foreach ($this->prefixMap as $entry) {
                $newElem = $entry->apply((string) $elem);

                // Note I'm using "!=" to see if we got a new object back from
                // the apply method.

                if ($newElem !== (string) $elem) {
                    $elem = $newElem;
                    break;// We applied one, so we're done
                }
            }
        }

        return $elem;
    }