diff --git a/docs/_data/sidebars/pmd_sidebar.yml b/docs/_data/sidebars/pmd_sidebar.yml
index 13470005b4..1725effaac 100644
--- a/docs/_data/sidebars/pmd_sidebar.yml
+++ b/docs/_data/sidebars/pmd_sidebar.yml
@@ -367,6 +367,12 @@ entries:
- title: Adding metrics support to a language
url: /pmd_devdocs_major_adding_new_metrics_framework.html
output: web, pdf
+ - title: Experimental features
+ output: web, pdf
+ subfolderitems:
+ - title: Creating (XML) dump of the AST
+ url: /pmd_devdocs_experimental_ast_dump.html
+ output: web, pdf
- title: Project documentation
output: web, pdf
folderitems:
diff --git a/docs/pages/pmd/devdocs/experimental/ast_dump.md b/docs/pages/pmd/devdocs/experimental/ast_dump.md
new file mode 100644
index 0000000000..8d65a25703
--- /dev/null
+++ b/docs/pages/pmd/devdocs/experimental/ast_dump.md
@@ -0,0 +1,121 @@
+---
+title: Creating XML dump of the AST
+tags: [devdocs, experimental]
+summary: Creating a XML representation of the AST allows to analyze the AST with other tools.
+last_updated: January 17, 2020 (6.21.0)
+permalink: pmd_devdocs_experimental_ast_dump.html
+---
+
+## Command line usage
+
+```shell
+$ run.sh ast-dump
+The following options are required: [--format | -f], [--language | -l]
+Usage: ast-dump [options] The file to dump
+ Options:
+ --encoding, -e
+ Encoding of the source file.
+ Default: UTF-8
+ * --format, -f
+ The output format.
+ --help, -h
+ Display usage.
+ * --language, -l
+ Specify the language to use.
+
+Available languages: apex ecmascript java jsp modelica plsql pom scala text vf vm wsdl xml xsl
+Available formats: xml
+
+Example: ast-dump --format xml --language java MyFile.java
+
+```
+
+## Example
+
+```shell
+$ cat Foo.java
+public class Foo {
+ int a;
+}
+
+$ run.sh ast-dump --format xml --language java Foo.java > Foo.xml
+-------------------------------------------------------------------------------
+This command line utility is experimental. It might change at any time without
+prior notice.
+-------------------------------------------------------------------------------
+Jan 17, 2020 10:08:58 AM net.sourceforge.pmd.lang.ast.xpath.Attribute getValue
+WARNING: Use of deprecated attribute 'CompilationUnit/@declarationsAreInDefaultPackage' in XPath query
+Jan 17, 2020 10:08:58 AM net.sourceforge.pmd.lang.ast.xpath.Attribute getValue
+WARNING: Use of deprecated attribute 'ClassOrInterfaceDeclaration/@Image' in XPath query
+Jan 17, 2020 10:08:58 AM net.sourceforge.pmd.lang.ast.xpath.Attribute getValue
+WARNING: Use of deprecated attribute 'FieldDeclaration/@Array' in XPath query
+Jan 17, 2020 10:08:58 AM net.sourceforge.pmd.lang.ast.xpath.Attribute getValue
+WARNING: Use of deprecated attribute 'FieldDeclaration/@VariableName' in XPath query
+Jan 17, 2020 10:08:58 AM net.sourceforge.pmd.lang.ast.xpath.Attribute getValue
+WARNING: Use of deprecated attribute 'FieldDeclaration/@ArrayDepth' in XPath query
+Jan 17, 2020 10:08:58 AM net.sourceforge.pmd.lang.ast.xpath.Attribute getValue
+WARNING: Use of deprecated attribute 'Type/@Array' in XPath query
+Jan 17, 2020 10:08:58 AM net.sourceforge.pmd.lang.ast.xpath.Attribute getValue
+WARNING: Use of deprecated attribute 'Type/@ArrayDepth' in XPath query
+Jan 17, 2020 10:08:58 AM net.sourceforge.pmd.lang.ast.xpath.Attribute getValue
+WARNING: Use of deprecated attribute 'PrimitiveType/@Array' in XPath query
+Jan 17, 2020 10:08:58 AM net.sourceforge.pmd.lang.ast.xpath.Attribute getValue
+WARNING: Use of deprecated attribute 'PrimitiveType/@ArrayDepth' in XPath query
+Jan 17, 2020 10:08:58 AM net.sourceforge.pmd.lang.ast.xpath.Attribute getValue
+WARNING: Use of deprecated attribute 'VariableDeclaratorId/@Array' in XPath query
+Jan 17, 2020 10:08:58 AM net.sourceforge.pmd.lang.ast.xpath.Attribute getValue
+WARNING: Use of deprecated attribute 'VariableDeclaratorId/@ArrayDepth' in XPath query
+
+$ cat Foo.xml
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+$ xmlstarlet select -t -c "//VariableDeclaratorId[@VariableName='a']" Foo.xml
+
+```
+
+This example uses [xmlstarlet](http://xmlstar.sourceforge.net/) to query the xml document for any variables/fields
+with the name "a".
+
+
+## Programmatic usage
+
+Just parse your source code to get the AST and pass it on to the `XmlTreeRenderer`:
+
+```java
+import java.io.IOException;
+import java.io.StringReader;
+
+import net.sourceforge.pmd.lang.LanguageRegistry;
+import net.sourceforge.pmd.lang.LanguageVersionHandler;
+import net.sourceforge.pmd.lang.Parser;
+import net.sourceforge.pmd.lang.ast.Node;
+import net.sourceforge.pmd.util.treeexport.XmlTreeRenderer;
+
+public class TreeExport {
+ public static void main(String[] args) throws IOException {
+ LanguageVersionHandler java = LanguageRegistry.getLanguage("Java").getDefaultVersion().getLanguageVersionHandler();
+ Parser parser = java.getParser(java.getDefaultParserOptions());
+ Node root = parser.parse("foo", new StringReader("class Foo {}"));
+
+ new XmlTreeRenderer().renderSubtree(root, System.out);
+ }
+}
+```
diff --git a/docs/pages/release_notes.md b/docs/pages/release_notes.md
index dfc524e70b..1abbae7cc8 100644
--- a/docs/pages/release_notes.md
+++ b/docs/pages/release_notes.md
@@ -25,6 +25,18 @@ While the language implementation is quite complete, Modelica support is conside
for now. This is to allow us to change the rule API (e.g. the AST classes) slightly and improve
the implementation based on your feedback.
+#### Simple XML dump of AST
+
+We added a experimental feature to dump the AST of a source file into XML. The XML format
+is of course PMD specific and language dependent. That XML file can be used to execute
+(XPath) queries against without PMD. It can also be used as a textual visualization of the AST
+if you don't want to use the [Designer](https://github.com/pmd/pmd-designer).
+
+This feature is experimental and might change or even be removed in the future, if it is not
+useful. A short description how to use it is available under [Creating XML dump of the AST](pmd_devdocs_experimental_ast_dump.html).
+
+Any feedback about it, especially about your use cases, is highly appreciated.
+
#### Modified Rules
* The Java rule {% rule "java/errorprone/AvoidLiteralsInIfCondition" %} (`java-errorprone`) has a new property