encoding
using purgeChild instead of replaceChild correctly frees memory after node is replaced