Trying to improve Elem.toString performance