So you don’t need to know the nodetypes allowed on the type definition but the actual value of an instance. That should be possible.
Document A should have a subnode Product which has a property hippo:docbase. That is the property you are looking for. If you are working from a bean you should have a getter for the subnode, getProduct, or in your case more likely getproducts as it is a multiple (so you will get a List). From that bean you can get the property with bean.getSingleProperty(“hippo:docbase”).
In terms of nodes it will be similar. You’d do something like
though again, you have a multiple, so you would use getNodes(“myproject:Product”), which returns an iterator.