Rewrote serializeDOM to support for dual DOM view