XForms provides the getInstanceDocument method to allow access to instance data within a model. An example of its use is here.
getInstanceDocument