|InfoPath Developer Reference|
Version Added: InfoPath 2003
The DocReturnEvent object provides the XDocument property that can be used within a load or submission event to programmatically interact with the data in a form's underlying XML document. It also provides the ReturnStatus property that is used to specify whether the event is successful.
For more information about using the DocReturnEvent object, see Responding to form events.
In the following example, the XDocument property of the DocReturnEvent object is used to display the source XML of a form's underlying XML document using the DOM property of the XDocument object: