Senior Lecturer in Biomechanics
Metropolitan College, in collaboration with University of East London
Biomechanics | Gait Analysis | Ontology Engineer | Prompt Engineer | AI | Recurrent Neural Networks
Posted on August 15, 2025
While XML and JSON are widely used for representing structured data in a general sense, they lack a standardized way to capture the unique needs of prompt engineering. POML builds on the familiar XML style but introduces prompt-specific semantics, templating logic, styling separation, and dedicated tooling. The table below illustrates how POML differs from traditional formats by focusing specifically on the requirements of LLM workflows.
POML helps teams manage large prompt libraries with clearer structure, reuse, and multimodal support, while tooling like IDE extensions and SDKs speeds up development. Many see it as a step toward treating prompt engineering more like software engineering, even if models themselves don’t inherently “understand” it—the real benefit lies in helping developers stay organized and scale their work. More than just markup, POML represents an effort to standardize and professionalize prompt design, and in a modest way, it may also shape the future of education by making AI interactions more structured, transparent, and accessible to learners and teachers alike
| Aspect | XML | JSON | POML |
|---|---|---|---|
| Structure | Generic hierarchical tags | Key–value pairs, lightweight | XML-like syntax tailored for prompts |
| Semantics | No fixed semantics, user-defined | No fixed semantics, user-defined | Predefined prompt tags (<role>, <task>, etc.) |
| Templating & Logic | Possible via external frameworks | Possible via external frameworks | Built-in support for variables, loops, conditionals |
| Styling | Not built-in (can be layered) | Not built-in (can be layered) | CSS-like system for tone/verbosity (optional) |
| Multimodal Support | Custom tags for media/links | Custom fields for media/links | Standard tags (<img>, <document>, etc.) |
| Tooling | Generic XML parsers/editors | Generic JSON parsers/editors | VS Code extension, SDKs, live preview, diagnostics |
| Use Case | Any structured data | APIs, configs, data exchange | Prompt engineering & LLM workflows |
XML and JSON can already represent structured data and even prompts, but POML standardizes a schema and provides dedicated tooling aimed specifically at Large Language Model workflows.
Below is a simple .poml (basically an xml) file describing a prompt from my domain about Parkinson’s Disease,
and a Python script that loads it, renders it into a prompt string, and sends it to OpenAI’s API.
role: You are a medical expert explaining Parkinson’s Disease.
task: Explain the main symptoms of Parkinson’s Disease to a first-year medical student.
output-format: Use clear language. Provide 4 bullet points. End with one short sentence about why early diagnosis matters.
run_poml.py
import os
import xml.etree.ElementTree as ET
from openai import OpenAI
# Path to your POML (XML) file
POML_PATH = "/home/ilab/test.pml/pd_poml.xml"
# --- Parse POML (XML) ---
root = ET.parse(POML_PATH).getroot()
def text(tag):
el = root.find(tag)
return (el.text if el is not None and el.text else "").strip()
role = text("role")
task = text("task")
outfmt = text("output-format")
# Build prompt string
parts = []
if role: parts.append(role)
if task: parts.append(f"\nTASK:\n{task}")
if outfmt: parts.append(f"\nOUTPUT FORMAT:\n{outfmt}")
prompt = "\n".join(parts).strip()
# --- OpenAI API ---
api_key = os.getenv("OPENAI_API_KEY", "").strip()
if not api_key:
raise RuntimeError("OPENAI_API_KEY is not set. Run: export OPENAI_API_KEY='sk-...'")
if any(ord(c) > 127 for c in api_key):
raise ValueError("OPENAI_API_KEY is not valid")
client = OpenAI(api_key=api_key)
resp = client.chat.completions.create(
model="gpt-4o-mini",
messages=[{"role": "user", "content": prompt}],
)
print("=== POML Prompt Output ===")
print(resp.choices[0].message.content)
Early diagnosis matters because it allows for timely intervention, which can help manage symptoms and improve the quality of life for patients.
pip install poml) exists, it is not yet as mature or fully featured as the official Node.js package (pomljs). At this stage, I found the Node.js SDK to be more complete for practical use, whereas in Python I had to rely on XML parsing as a workaround.
Imagine a university department specializing in Rehabilitation Sciences with a focus on neurodegenerative diseases and PD. The program is taught by several professors, each responsible for a different thematic area (e.g., motor control, neurobiology, clinical interventions, assistive technology).
With POML, the faculty can design a shared prompt library that reflects the curriculum structure. For instance:
Because POML supports templating and modularization, these contributions can be combined into a coherent workflow where students interact with AI tutors. Depending on the student’s level (e.g., undergraduate vs. postgraduate) or focus area (e.g., diagnostics vs. therapy), the system can automatically adjust the depth, style, and complexity of the teaching material.
In this way, POML enables multi-professor collaboration while maintaining a standardized format, ensuring that the educational experience is consistent, scalable, and adaptive. This illustrates how structured prompt engineering can become a foundation for personalized, AI-enhanced education.
Most importantly, the human tutor remains in full control, guiding and validating the AI-generated content at every step. This control is reinforced because the tutor can reproduce the outputs of the prompts at will or rely on a Retrieval-Augmented Generation (RAG) system, where the AI draws its information directly from specific course documents and materials, ensuring accuracy and alignment with the official curriculum (see image 2).
PD gait assessment
postgraduate
rehabilitation student
You are a faculty tutor guiding a {{level}} {{audience}}.
Explain how Parkinson’s Disease affects gait and outline a basic assessment protocol.
Include red flags that warrant referral and 2 short case-study prompts for practice.
Emphasize {{topic}} and clinical reasoning.
- Short overview (3–4 sentences)
- Bullet list: assessment steps (5–6 items)
- Red flags (3 items)
- Two case-study prompts (1–2 sentences each)