rewrite ElementName in scala