diff --git a/Makefile.in b/Makefile.in
index d0ffe3c93..d79d0b2ff 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -148,6 +148,7 @@ DISTFILES_INC = $(INFOS) .gitignore \
docs/install.adoc \
docs/internals.adoc \
docs/verilator_logo.png \
+ docs/xml.adoc \
install-sh configure *.pod \
include/*.[chv]* \
include/*.in \
diff --git a/docs/xml.adoc b/docs/xml.adoc
new file mode 100644
index 000000000..a501095d8
--- /dev/null
+++ b/docs/xml.adoc
@@ -0,0 +1,65 @@
+= Verilator XML Output
+:toc: right
+
+// Github doesn't render unless absolute URL
+image::https://www.veripool.org/img/verilator_256_200_min.png[Logo,256,200,role="right"]
+
+== Introduction
+
+This document describes Verilator's XML output. For more general information
+please see https://verilator.org[verilator.org].
+
+== General
+
+Verilator's XML output is enabled with the `--xml-only` flag. It contains
+limited information about the elaborated design including files, modules,
+instance hierarchy, logic and data types. There is no formal schema since part
+of the structure of the XML document matches the compiled code which would
+require the schema to describe legal SystemVerilog structure. The intended
+usage is to enable other downstream tools to take advantage of Verilator's
+parser.
+
+== Structure
+
+The XML document is consists of 4 sections within the top level `verilator_xml`
+element:
+
+``...``::
+
+This section contains a list of all design files read, including the
+built-in constructs and the command line as their own entries. Each
+`` has an attribute `id` which is a short ASCII string unique to that
+file. Other elements' `loc` attributes use this id to refer to a particular
+file.
+
+``...``::
+
+All files containing Verilog module definitions are listed in this section.
+This element's contents is a subset of the `` element's contents.
+
+``...``::
+
+The cells section of the XML document contains the design instance
+hierarchy. Each instance is represented with the `| ` element with the
+following attributes:
+
+* `fl` (deprecated): The file id and line number where the module was
+ instanced. Use `loc` instead.
+
+* `loc`: The file id, first line number, last line number, first column
+ number and last column number of the identifier where the module was
+ instanced, separated by commas.
+
+* `name`: The instance name.
+
+* `submodname`: The module name uniquified with particular parameter values (if any).
+
+* `hier`: The full hierarchy path.
+
+``...``::
+
+The netlist section contains a number of ``...`` elements,
+each describing the contents of that module, and a single ``...
+`` element which lists all used types used within the
+modules. Each type has a numeric `id` attribute that is referred to by
+elements in the `` elements using the `dtype_id` attribute.
|