elements aren't aware of their parent node, so instead, calls to to_hash need to provide whether the current element is the root node