The generalized doc() and serialize() functions

The doc() function is to be used to get any document of any type from any source.

The default scheme is, at browser-side, "http" and, at server-side, "file". A scheme "cmd" is to be added to also get data from local process execution.

An optional second parameter, similar to serialization options, allows to specify non-XML media-type and format specific parameters such as field separator for CSV data. When not present, the file extension, if there is one, is used to get an implicit media-type.

An optional third parameter will be added to specify a node containing the grammar to be considered for Invisible XML processing.

Non-XML data is automatically parsed by the doc() function. The resulting document can be navigated with the corresponding node types mapping. There is not necessarily an XML tree for non-XML data. For example, a .xlsx file, when parsed, is proposed as a map with, as entries, all the files within the ZIP format while Markdown text is proposed as the corresponding XHTML node tree.

The serialize() function has a similar optional second parameter to, possibly, serialize from one notation to another.