Very nice. I did something in a similar spirit eons ago for capturing CLI tool output directly into my docbook-based documentation. In my case it was also part of a build, generating intermediate .xml prior to running the docbook build.

Ancient historical reference: https://martiansoftware.com/lab/rundoc