This reverts commit 5e4a9f8ff2. The tree should not be modified, as it's the returned value. We need an additional tree for parent-child element connections.
5e4a9f8ff2
as_dom