Build a document tree, using options set on this Configuration and on the supplied source object. Options set on the source object override options set in the Configuration. The Source object must be one of the kinds of source recognized by Saxon, or a source that can be resolved using the registered {@link SourceResolver}.
@param source the Source to be used. This may be an {@link AugmentedSource}, allowing options to be specified for the way in which this document will be built. If an AugmentedSource is supplied then options set in the AugmentedSource take precendence over options set in the Configuration.
From Saxon 9.2, this method always creates a new tree, it never wraps or returns an existing tree.
@return the document node of the constructed document
@throws XPathException if any errors occur during document parsing or validation. Detailederrors occurring during schema validation will be written to the ErrorListener associated with the AugmentedSource, if supplied, or with the Configuration otherwise.
@since 8.9. Modified in 9.0 to avoid copying a supplied document where this is notnecessary. Modified in 9.2 so that this interface always constructs a new tree; it never wraps an existing document, even if an AugmentedSource that requests wrapping is supplied.