XML Inclusions (XInclude) This document describes the xinclude:include function, which implement subset of XML Inclusions. This function reads XML document and translates it to a SXML tree replacing the include element, which corresponds Xinclude, by proper SXML tree. Also xinclude:include is suitable for simple XPath queries. (More precisely, function implements subset of SXPath extractions and recursively processes XInclude elements.) XInclude Version 1.0. (http://www.w3.org/TR/2001/WD-xinclude-20010516) introduces a generic mechanism for merging XML documents (as represented by their information sets) for use by applications that need such a facility. The syntax uses existing XML constructs - elements, attributes, and URI references. Syntax: XInclude defines a namespace associated with the URI http://www.w3.org/2001/XInclude. The XInclude namespace contains a single element with the local name include. The include element has the following attributes: href A URI Reference indicating the location of the resource to include. This attribute is required. parse Value of parse specifies whether to include the resource as parsed XML or as text. A value of "xml" indicates that the resource must be parsed as XML and the infosets merged. A value of "text" indicates that the resource must be included as the contents of a text node. This attribute is optional. When omitted, the value of "xml" is implied (even in the absence of a default value declaration). Values other than "xml" and "text" are errors. (xinclude:include xml-port parse path xinclude-history) reads XML document from xml-port and generates SXML tree. If processed element corresponds Xinclude include then it recursively invokes this function and delivers the inclusion. This function supports namespaces. parse corresponds to attribute parse in Xinclude. When parse = xml resource is considered as XML document and function implements the inclusion extracting parts of document defined by path. When parse = text resource is considered as plain text and its structure is ignored. When parse is omitted, "xml" is implied path is a subset of location path (see SXPath an Xpath). This function supports only sequence of elements. In XML document value of href attribute in XInclude element must be only "name.xml#tag1/.../tagN". And such URI will be represented in path as (tag1 ... tagN) If parse = text then path is ignored. xinclude-history is used for avoidance inclusion loops and contains values of href attributes, which have already processed. If current location has already processed function fixes error and returns empty list.