Is X3DOM an example of solution to what you are trying to do? They embed hierarchical data directly in HTML docs through namespaces and have JavaScript use that data http://www.x3dom.org/ I believe Angular does this as well. http://angularjs.org/