using name() here but $name was produced using local-name() on line 92.  The original code ignored the namespace of the sentence coming from the editor, applying the namespace of the original sentence. To do the same here, I think maybe we need to to use local-name() in the element name test here.