WIP: Selser rework for the DOM-based serializer

Change-Id: I62d722d59c7a6f47499b571b5ac67cd1f935d3dc