diff --git a/doc/functions.xml b/doc/functions.xml
index e8ab8d97b913..f2d064023177 100644
--- a/doc/functions.xml
+++ b/doc/functions.xml
@@ -8,7 +8,7 @@
-
+
diff --git a/doc/functions/debug.section.md b/doc/functions/debug.section.md
new file mode 100644
index 000000000000..b2d8589431ab
--- /dev/null
+++ b/doc/functions/debug.section.md
@@ -0,0 +1,5 @@
+# Debugging Nix Expressions {#sec-debug}
+
+Nix is a unityped, dynamic language, this means every value can potentially appear anywhere. Since it is also non-strict, evaluation order and what ultimately is evaluated might surprise you. Therefore it is important to be able to debug nix expressions.
+
+In the `lib/debug.nix` file you will find a number of functions that help (pretty-)printing values while evaluation is running. You can even specify how deep these values should be printed recursively, and transform them on the fly. Please consult the docstrings in `lib/debug.nix` for usage information.
diff --git a/doc/functions/debug.xml b/doc/functions/debug.xml
deleted file mode 100644
index c27421f12e76..000000000000
--- a/doc/functions/debug.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
- Debugging Nix Expressions
-
-
- Nix is a unityped, dynamic language, this means every value can potentially appear anywhere. Since it is also non-strict, evaluation order and what ultimately is evaluated might surprise you. Therefore it is important to be able to debug nix expressions.
-
-
-
- In the lib/debug.nix file you will find a number of functions that help (pretty-)printing values while evaluation is runnnig. You can even specify how deep these values should be printed recursively, and transform them on the fly. Please consult the docstrings in lib/debug.nix for usage information.
-
-