LibSBML API contemplated a toSBML() method to all SBase inheritors that provided an SBML String representation of the element. This is not yet available in jsbml
public String toSBML()
Returns a string that consists of the partial SBML describing this object. This is primarily provided for testing and debugging purposes. It may be removed in a future version of libSBML.
So, we will have to check with the SBML guys but this function might be useful anyway for us. It should be possible to start the stax parser from any point in the tree, may be with some adjustment.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
This is the javadoc from libsbml :
public String toSBML()
Returns a string that consists of the partial SBML describing this object. This is primarily provided for testing and debugging purposes. It may be removed in a future version of libSBML.
So, we will have to check with the SBML guys but this function might be useful anyway for us. It should be possible to start the stax parser from any point in the tree, may be with some adjustment.