Chapter 20: XML Server

XML on the server — written as if I’m sitting next to you, explaining step by step like a patient teacher who wants you to really understand how XML is actually used on server-side systems in real projects (even in 2025–2026).

We will go slowly and cover the most common and realistic scenarios:

  • Why XML is still used on servers (despite JSON dominance)
  • The main roles XML plays on the server
  • Typical server-side workflows
  • Concrete examples in different languages/contexts
  • Modern patterns vs legacy patterns

Let’s begin.

1. Why is XML still used on the server in 2025–2026?

Even though JSON is the dominant format for new APIs, XML continues to be very important on servers for several strong reasons:

Reason Typical situations / industries Still very active in 2025–2026?
Legacy systems & integration Banks, insurance, ERP, government, telecom, healthcare Very much so
Mandatory standards SOAP web services, EDI (EDIFACT, X12), e-Invoicing (UBL, PEPPOL, GST India), ISO 20022, HL7 CDA Extremely common
Strong schema validation requirement Financial messages, legal documents, medical records Very strong
Very large documents + streaming processing Batch invoices, customs declarations, catalog feeds Yes (StAX, SAX, XmlReader…)
Mixed content & document-oriented data Publishing (DocBook, DITA), office formats (OOXML) Still used
Some companies just never migrated Many enterprise Java, .NET, SAP systems Common

Bottom line: If you work with enterprise software, financial systems, government portals, healthcare, or legacy integration, you will meet XML on the server — often a lot of it.

2. Most Common Ways XML is Used on the Server

# Use Case Typical technology stack Input / Output ? Most common today?
1 SOAP Web Services Java (JAX-WS), .NET (WCF), PHP (SoapServer) Both Still very common
2 REST API that returns XML Spring Boot, ASP.NET Core, Express.js Mostly output Declining but exists
3 File-based integration (batch) Spring Batch, Apache Camel, custom scripts Input + Output Very common
4 e-Invoicing / e-Document exchange Custom middleware, SAP, Oracle, Tally, ClearTax Input + Output Extremely active
5 Configuration files Spring, Java EE, Apache Tomcat, JBoss Input Still used
6 Report generation (XML → PDF/HTML) XSLT + Apache FOP, Flying Saucer, iText Input → transformed Common

3. Realistic Example 1 – SOAP Web Service (very common legacy & enterprise case)

Server receives and returns XML

Typical SOAP request (XML input)

XML

Server code – Java Spring Boot + JAX-WS style (simplified)

Java

Generated XML response (automatic via JAXB)

XML

Key point: The server never manually builds XML strings — modern frameworks (JAX-WS, Spring WS, .NET WCF, Apache CXF…) use JAXB, Jackson XML, or similar to automatically convert objects ↔ XML.

4. Realistic Example 2 – REST API that returns XML (still exists)

Spring Boot controller returning XML

Java

Corresponding model class (JAXB annotated)

Java

Output XML when calling /api/v1/products/P-784512

XML

Key point: Even in REST APIs, some clients (especially enterprise / government / legacy systems) still demand XML instead of JSON.

5. Realistic Example 3 – Processing large incoming XML file (batch / file integration)

Common scenario: A bank or customs department receives large XML files (thousands of invoices, declarations…)

Typical server-side processing (Java + StAX – streaming)

Java

Why streaming (StAX / SAX / XmlReader) instead of DOM?

  • Files can be several GB
  • DOM would load everything → OutOfMemoryError
  • Streaming → constant low memory usage

6. Quick Summary – XML on the Server in 2025–2026

Role / Usage Most common technologies JSON or XML? Typical server language
SOAP Web Services JAX-WS, Spring WS, Apache CXF, .NET WCF XML Java, C#
REST API with XML support Spring Boot, ASP.NET Core, FastAPI + xmltodict JSON + XML Java, C#, Python
Batch / file exchange Spring Batch, Apache Camel, custom scripts XML Java, Python, C#
e-Invoicing / government exchange Custom middleware, SAP, Tally, ClearTax, NIC XML (UBL, GST format) Java, .NET, Python
Legacy configuration Spring, Java EE, Apache Tomcat XML Java
Report generation (XML → PDF / HTML) XSLT + FOP, Docx4j, Flying Saucer XML → other formats Java, .NET

Most realistic advice in 2025–2026:

  • If you are starting a new project → prefer JSON unless forced by standard
  • If you work in enterprise / finance / government / healthcare / logisticsyou will meet XML very often
  • Learn to read, generate, validate, and transform XML — especially streaming techniques

Would you like to go deeper into any of these directions?

  • Creating a complete SOAP service example
  • Processing large XML files (real batch example)
  • Modern Spring Boot with both JSON and XML endpoints
  • How GST e-invoice XML is handled on server in India
  • Generating PDF from XML (XSLT + FOP example)
  • Migrating old XML services to JSON (common patterns)

Tell me what interests you most right now! 😊

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *