XML instantiation by xpath
i´m wondering if there is an API, that offers me the following possibility:
Let us assume, we have a XML Schema defining valid documents and an XPath describing a certain ressource in an xml document. Is there an API (e.g., JAXB) that offers me the possibility to "automatically" create the needed elements in order to insert a value into the element/attribute adressed with the XPath? In the terms of JAXB the whole object structure has to be build.
I know this is a quite heavy task, because of possible dependencies, but perhaps there is a way to solve that. Just building a vast number of if-else-blocks can´t be the right way.
Any ideas? Thanks for your help.