Ilumis Straight to the Point Tax Process

Learning through doing – building an MRDP conversion in python.

Recently, I found myself working on something completely new: a Python-based MRDP platform reporting conversion. It wasn’t something I’d tackled before, and with a tight one-week deadline, the pressure was on!

A client came to us needing support with an MRDP submission. My role was to build a solution that could take structured Excel data and transform it into a fully compliant XML file ready for submission. Sounds simple, right?

While I’m comfortable working with Python and data logic, MRDP reporting (and its associated XML schema) was unfamiliar territory. The requirements were highly prescriptive and the schema validation unforgiving. To make things more interesting, there were few existing solutions to lean on, meaning this needed to be built specifically for the use case from the ground up.

With the clock ticking, the first priority was clarity.

Starting with the schema

I began by getting to grips with the HMRC XML schema (XSD). Understanding what the final output had to look like was critical. Everything else could be worked backwards from there. HMRC’s published XSDs act as the definitive guide to what data is required, depending on the reporting obligations of the platform operator.

Using this, I designed an Excel input template that captured all mandatory fields in a structured, predictable way. This spreadsheet could then be shared with the client to gather the required data, while also acting as a clean and controlled input for the conversion itself.

At this point, the shape of the report was clear, so it was time to start building.

The Python conversion

Without diving too far into the weeds, the goal of the script was simple:

take structured Excel input and produce XML that matches HMRC’s MRDP schema exactly.

To do that reliably, the solution was built around three core principles:

  • Controlled inputs
  • Predictable structure
  • Explicit mapping

Rather than trying to infer or dynamically interpret data, the script assumes a clearly defined Excel format. Each worksheet represents a logical section of the MRDP report, such as message specifications or platform operator details, making the conversion deterministic and repeatable.

To minimise the risk of schema mismatches, the script reads an HMRC example XML file and copies its root elements, namespaces, and attributes directly. This ensured the generated output matched an HMRC-accepted structure from the outset.

From there, each section of the XML is built explicitly using dedicated Python functions. Every XML element is mapped directly to its corresponding Excel field, with lightweight validation checks applied along the way to surface issues early, not at submission time.

The outcome

The result was a working Python-based MRDP conversion that successfully transformed Excel input into valid, schema-compliant XML. The client’s reporting requirement was met on time, and the solution was robust enough to be reused or adapted for future submissions.

Just as importantly, it added a new capability to my skill set – one I hadn’t expected to develop at the start of the project, but one that’s now firmly in the toolbox

Next post
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible and recognise you when you return to our website. See our Privacy Policy for more information.

Necessary

Strictly necessary cookies are enabled at all times so that we can save your preferences for cookie settings.

Marketing

This website uses LinkedIn Insight marketing cookies to measure ad conversions, understand site activity, and improve campaign performance and reporting.