Add toElement and fromElement