     ## Remove from the symbol any top-level xmlns=SVGNS or xmlns:xlink,
     ## in the original parsed content or possibly added above,
     ## to avoid conflict with these attributes in the top-level <svg>.
-    @xml.documentElement.removeAttribute 'xmlns'
+    @dom.documentElement.removeAttribute 'xmlns'
     unless @getSetting 'useHref'
-      @xml.documentElement.removeAttribute 'xmlns:xlink'
+      @dom.documentElement.removeAttribute 'xmlns:xlink'
 
     ## Wrap XML in <symbol> if not already.
-    symbol = @xml.createElementNS SVGNS, 'symbol'
+    symbol = @dom.createElementNS SVGNS, 'symbol'
     ## Force `id` to be first attribute.
     symbol.setAttribute 'id', @id if @id?
     # Avoid a layer of indirection for <symbol>/<svg> at top level
-    if @xml.documentElement.nodeName in ['symbol', 'svg'] and
-       not @xml.documentElement.nextSibling?
-      for attribute in @xml.documentElement.attributes
+    if @dom.documentElement.nodeName in ['symbol', 'svg'] and
+       not @dom.documentElement.nextSibling?
+      for attribute in @dom.documentElement.attributes
         unless attribute.name in ['version', 'id'] or attribute.name.startsWith 'xmlns'
           symbol.setAttribute attribute.name, attribute.value
-      doc = @xml.documentElement
-      @xml.removeChild @xml.documentElement
+      doc = @dom.documentElement
+      @dom.removeChild @dom.documentElement
     else
-      doc = @xml
+      doc = @dom
     for child in (node for node in doc.childNodes)
       symbol.appendChild child
-    @xml.appendChild symbol
+    @dom.appendChild symbol
 
     ## <image> processing
-    domRecurse @xml.documentElement, (node) =>
+    domRecurse @dom.documentElement, (node) =>
       if node.nodeName == 'image'
         ###
         Fix image-rendering: if unspecified, or if specified as "optimizeSpeed"

          @viewBox[3] = zeroSizeReplacement
      ## Reset viewBox attribute in case either absent (and computed via
      ## svgBBox) or changed to avoid zeroes.
      @xml.documentElement.setAttribute 'viewBox', @viewBox.join ' '
    @overflowBox = extractOverflowBox @xml
    @width = forceWidth if (forceWidth = @getSetting 'forceWidth')?
    @height = forceHeight if (forceHeight = @getSetting 'forceHeight')?
    warnings = []

      console.warn "Failed to detect #{warnings.join ' and '} of SVG for tile '#{@key}'"
    ## Detect special `width="auto"` and/or `height="auto"` fields for future
    ## processing, and remove them to ensure valid SVG.
    @autoWidth = isAuto @dom, 'width'
    @autoHeight = isAuto @dom, 'height'
    @dom.documentElement.removeAttribute 'width' if @autoWidth
    @dom.documentElement.removeAttribute 'height' if @autoHeight
    @zIndex = extractZIndex @dom.documentElement
    ## Optionally extract <text> nodes for LaTeX output
    if @getSetting 'texText'
      @text = []
      domRecurse @dom.documentElement, (node, parent) =>
        if node.nodeName == 'text'
          @text.push node
          parent.removeChild node
          false # don't recurse into <text>'s children
        else
          true
    @dom

## Tile to fall back to when encountering an unrecognized key.
## Path from https://commons.wikimedia.org/wiki/File:Replacement_character.svg
