Not all keyword assignments would constitute a hierarchy. For example take just three elements with two keywords (let say 'a' and 'b'). One element with both keywords and two others with a different one of them. Using your algorithm you would get "a/1, a/b/2, /b/3", this is not hierarchy because you can find b directly under root and under 'a'.
Keywords assignements constitute only a partial order, to get a tree you need the additional property of well orderedness - see Tree Set Theoretic.
By the way I belive tags are a fad. What is really needed is full text search for bookmarks (or better for whole browser history). More arguments on my wiki: Tags Or Searchable Cache.
I am thinking about writing a web site engine for that, this should not be very complicated.