I'm very much with you on the ability for a client to reference directly to a sub-entity but having a hard time wrapping my head around the implementation of a top level unique id.

Things I like about sub-entities is the decoupling between entities, their re-usability, and the affordance to infinitely nest.  It seems a unique id, relative to the root level document would make that all very tricky to implement.  What is the closest parallel to sub-entities in HTML?