implement Element getTree with depth

fixes #36