Now it sounds link you don't care about structure you want to know content of layers in a document. Do you actually know what you want. Do you want a database to search to query layers names and content. Is there metadata identifying layer contents I would imagine many layer names my just be Photoshop default names.
Also no one wrote anything about flattening documents.