Element classes are not relevant for serialisation. As documented, all state must be stored in the tree, not in the element classes. If you set "self.tag" from your class, you will get the expected result.
Element classes are not relevant for serialisation. As documented, all state must be stored in the tree, not in the element classes. If you set "self.tag" from your class, you will get the expected result.