Several ways to do this.
Latex in Markdown files, markdown in Latex files, and conversion between the two...
https://mathpix.com/markdown-to-latex
https://www.overleaf.com/learn/how-to/Writing_Markdown_in_LaTeX_Documents
Interesting to me was the ability to do syntax highlighting from markdown... it seems easier than listings and might work better than XML for use with XLingPaper