# DocLang response format for AI agents — ADN — ADN

← Back to Learn DocLang is ADN's structured document format for machine-readable page content. Where Markdown is a lightweight text representation, DocLang is an explicit XML vocabulary that preserves semantic structure — headings, paragraphs, lists, tables, links, and code blocks — so agents can parse pages without re-deriving layout from HTML or guessing at Markdown conventions.
 Why a second format?
 Markdown is excellent for human-readable content and token-efficient delivery. But agents that need to:
 • Extract tables with column headers
 • Distinguish heading levels reliably
 • Pull code blocks with language metadata
 • Walk lists without ambiguous nesting
 …benefit from a format that encodes those semantics directly. DocLang fills that gap without sending the full HTML document.
 Format basics
 DocLang documents use the media type application/vnd.doclang.document+xml and the .dclg file extension.
 <doclang>
 <heading>Pricing</heading>
 <text>Simple plans for every team.</text>
 <heading level="2">Starter</heading>
 <list>
 <ldiv/>100k requests
 <ldiv/>Markdown + DocLang + JSON-LD
 </list>
 <table>
 <ched/>Plan<ched/>Price<nl/>
 <cdiv/>Starter<cdiv/>$29<nl/>
 </table>
 <code>
 <label value="bash"/>
 <content>curl -H "Accept: application/vnd.doclang.document+xml" https://example.com/pricing</content>
 </code>
</doclang> Key elements:
 Element Purpose
 <heading> / <heading level="N"> Section titles
 <text> Paragraph body
 <list> / <ldiv/> Unordered list items
 <table> / <ched/> / <cdiv/> Tables with header and data cells
 <code> / <label> / <content> Code blocks with optional language
 <href uri="..."> Inline links
 How to fetch DocLang
 ADN gateways support three access patterns:
 1. Content negotiation (preferred):
 GET /pricing HTTP/1.1
Accept: application/vnd.doclang.document+xml 2. URL suffix fallback (for agents that do not send Accept headers):
 GET /pricing.dclg
GET /index.dclg 3. MCP tool call (for IDE agents):
 {"method": "tools/call", "params": {"name": "get_page", "arguments": {"path": "/pricing", "format": "doclang"}}}
 Discovery
 ADN manifests at /.well-known/adn.json include a doclang resource template. Link headers advertise rel="doclang" pointing to /index.dclg , and llms.txt lists DocLang URLs alongside Markdown for each page.
 Try it on this site
 This marketing site publishes its own homepage as DocLang:
 curl -H "Accept: application/vnd.doclang.document+xml" https://www.agent-delivery.network/
curl https://www.agent-delivery.network/index.dclg Both return the same structured document extracted from the HTML you see in a browser.
 Same shape, different format
 DocLang is not a sixth response shape in ADN's routing matrix. It is an alternative payload within the clean content shape — alongside Markdown and JSON-LD. Intent classification and rate policy are identical; only the serialization changes.
 Frequently asked
 When should I use DocLang instead of Markdown? Use DocLang when your agent or framework needs reliable structure — headings with levels, tables with column headers, code blocks with language labels — without writing a custom HTML or Markdown parser. Markdown is lighter and human-readable; DocLang is explicit and machine-parseable.
 How do I request DocLang from an ADN gateway? Send Accept: application/vnd.doclang.document+xml for content negotiation, or fetch the .dclg URL suffix (e.g. /pricing.dclg or /index.dclg for the homepage). MCP tools can also request format: doclang via get_page.
 Does DocLang replace Markdown? No. Both are served from the same ingest pipeline and count as the same response shape (clean content). Agents choose the format that fits their parser. Googlebot and social unfurlers still receive passthrough HTML only.
 Continue reading
 HTML vs Markdown: what AI crawlers actually cost you
 Nine intent classes explained
 MCP for documentation: serve IDE agents without scraping
 Run the free scan on your URL to see what AI receives today.
 Ask ADN