Fixed encodeForXmlAttribute() to advance iterator position when inserted special character replacement text