I Tried to Prove DocLang Beats Markdown for PDF→LLM. The Data Said Otherwise. A developer's experiment comparing DocLang XML markup to Markdown for feeding PDFs to LLMs found that all three representations produced identical answers—100% accuracy on facts and 87.5% on structure questions—when the whole document was in context, with Markdown being fastest and cheapest per call. The test used a 15-page construction RFP parsed once into a DoclingDocument and serialized by docling-core's first-party exporters, with gpt-5.4-mini via Azure OpenAI as the model. DocLang's expected advantage in locating answers did not materialize, and its output lacked hierarchical structure due to the layout model's failure to recover exhibit groupings. If you’re building anything that feeds PDFs to an LLM — RAG, document Q&A, contract review — you hit the same fork early: what text representation do you hand the model? The default answer is Markdown. Parse the PDF, export to markdown , stuff it in the context window. It's cheap, it's readable, every tokenizer likes it. The newer answer is DocLang https://www.doclang.ai/ — an XML-based, “AI-native” markup for unstructured documents. It keeps headings, lists, tables, reading order, and even bounding-box coordinates, all in a schema designed to be read directly by a language model. On paper it should dominate Markdown: same content, but structured . I went in wanting DocLang to win. I built the experiment to show it. Here’s what actually happened. Source document: a real “General Conditions and Fee Request for Proposal” — a 15-page construction RFP with a project-info section and six exhibits A–F . It’s a scanned-style PDF, the kind you actually get in the wild. The critical design choice — one parse, many renderings. My first attempt at this experiment had a fatal flaw: I compared my hand-written PDF→DocLang converter against Docling’s mature, years-tuned Markdown exporter. That’s not “Markdown vs DocLang.” That’s “my weekend project vs a library with hundreds of contributors.” So I rebuilt it. The PDF is parsed once into a DoclingDocument. Then every representation is produced by docling-core's own first-party serializers on that single shared object: No hand-written converter anywhere in the loop. Any difference between the arms is now attributable to the notation , not to converter maturity. The model: gpt-5.4-mini via Azure OpenAI, JSON-mode, whole document in the system prompt. The questions: two sets, each graded by an LLM judge against a gold answer and a gold location “which section/exhibit is this in?” . Everything is in the repo: doclang-impl/experiment/ — prepare inputs.py builds the arms, run ci.py runs the comparison. With the whole document in context, all three representations produced the same answers — 100% on facts, 87.5% on structure questions. The one structure-set miss “is there a substantive Exhibit G?” was shared by every arm: it’s a text-extraction gap, not a format gap. The notation did not change whether the model could find and state the answer . Not for flat facts, not for “which exhibit is this in,” not for cross-references. Here’s where it gets expensive: That’s a per-call cost you pay on every single query, for zero measured accuracy gain on this document. No surprise, but worth showing: more input tokens → slower first token. Markdown was fastest in every cell. The scatter makes it plain — the three arms form three vertical bands by token count, and latency climbs with them. This is the one I expected DocLang to win — “which section is this answer in?” is exactly what structure should help with. The per-question grid shows where the misses land: The answer squares are almost all green. The red dots — wrong cited location — cluster on “DocLang no locations .” Here’s the thing I didn’t expect. When I looked at what export to doclang actually produced: