Skip to content

XML, MCP, and Language Models

· Balisage Series on Markup Technologies · 0 citations

TL;DR

A “separation of concerns” (between the generative model and the structured data it consults) is proposed as a principled, declarative approach to AI-assisted XML work.

Abstract

This paper reflects on experiments to integrate Small Language Models (SLMs) with XML technologies in academic Digital Humanities work, and discusses the “DigitAI” project. The project is motivated by two goals for making AI systems: 1) more educationally transparent and 2) more economically and environmentally sustainable. We first attempted to make a small local Qwen model serve as an assistant for questions about applying the TEI P5 Guidelines. We provided Qwen with a Retrieval Augmented Generation (RAG) system built from the TEI P5 Guidelines, using XSLT to transform the guidelines into a neo4j knowledge graph. This approach proved both bloated and disappointing: the model's conversion of structured XML data into word embeddings eroded the precision of the original markup, and the outputs of prompts reflected “hallucination” and inaccuracy. Learning from this failure, we came to realize that XML should be kept as XML, held apart from the language model's internal machinery, and made accessible instead through a Model Context Protocol (MCP) server that allows the SLM to query the TEI document tree directly using XPath and related XML stack technologies. We have been experimenting with MCP scripting and evaluating how well SLMs apply XPath, XSLT, and XQuery parsers, giving them agency to evaluate and contribute to XML and TEI XML projects. Much of our learning process has been in preparing a containerized system with Docker for our project to run safely in controlled conditions on personal computers, and to share with others across platforms. Reflecting on our experience, we propose a “separation of concerns” (between the generative model and the structured data it consults) as a principled, declarative approach to AI-assisted XML work.

View source

Similar papers

Open access Sep 2026

Large language models as digital libraries: a multi-benchmark and multi-model study

Querying LLMs as digital libraries is feasible, but its effectiveness depends on model strength, deployment conditions, dataset structure, and execution strategy, and Galois remains valuable when relational discipline and controlled query execution are required.

Mirco Cazzaro, G. Silvello · 0 citations

From XML to Holons

This paper traces a personal and technical journey from the HTML Document Object Model of 1996 through XML, XSLT, XSD, XSD, XQuery, RDF, SHACL, and the neural systems of the present day, arriving at the holonic graph as the resolution of a tension that has persisted, largely unacknowledged, throughout the life of the m...

K. Cagle · 0 citations
Preprint Jul 2026

MORE: A Multilingual Document Parsing Benchmark and Evaluation

Multilingual documents encapsulate rich regional cultures, scientific discoveries, and historical records. Parsing this content into structured, machine-readable formats is critical for unlocking global knowledge. However, existing benchmarks predominantly focus on high-resource languages like English and Chinese, crea...

Long Xu, Binghong Wu, Ting-Ting Yu et al. · 3 citations
Book Open access Aug 2026

Docling: Converting Complex Documents into AI-Ready Structured Representations

By bridging the gap between visually complex documents and machine-readable knowledge, Docling provides a foundation for reliable document understanding in next-generation AI systems.

P. Staar · 0 citations
Preprint Aug 2026

Code as Representation: A Compilable Parsing Paradigm for Academic Documents

Compilable Academic Document Parsing (CADP) is proposed, a paradigm that reconstructs a full page as contextual \LaTeX{} plus executable Python, so that structure-preserving elements and executable chart representations can be reconstructed, recompiled, and directly verified against the source page.

Rihui Jin, Jun Wang, Chen Zhu et al. · 0 citations
Conference Jul 2026

Smart Campus Assistant using RAG-based AI

This paper presents the design and implementation of intelligent chatbots using Retrieval-Augmented Generation architecture to derive accurate, context-based responses from domain-specific knowledge sources such as PDFs and CSV files. The proposed system integrates information retrieval mechanisms with large language m...

Varsha Spoorthi Shree Narravula, V. K, Yashaswini B. Suresh et al. · 0 citations

We use cookies to run the site and, with your consent, for analytics and to show ads. See our Cookie Policy.