Applying Jens Erat's code to transform sequence of elements to tree
formatting
switching back to reading doc from db