an encoder for make dom easy to convert into small string