Last updated
What Does the XML Diff Viewer Do?
The XML Diff Viewer compares two XML documents structurally — not just line by line — and highlights added, removed, and modified elements, attributes, and text content. Formatting differences like whitespace and indentation are ignored, so only semantic changes are shown.
Basic XML Comparison
Document A (original):
<?xml version="1.0"?>
<config>
<database>
<host>localhost</host>
<port>5432</port>
<name>myapp_dev</name>
</database>
<cache enabled="false">
<ttl>300</ttl>
</cache>
</config>
Document B (modified):
<?xml version="1.0"?>
<config>
<database>
<host>db.production.com</host>
<port>5432</port>
<name>myapp_prod</name>
<pool>10</pool>
</database>
<cache enabled="true">
<ttl>3600</ttl>
</cache>
</config>
Diff result:
MODIFIED /config/database/host
Old: localhost
New: db.production.com
UNCHANGED /config/database/port (5432)
MODIFIED /config/database/name
Old: myapp_dev
New: myapp_prod
ADDED /config/database/pool
Value: 10
MODIFIED /config/cache[@enabled]
Old: false
New: true
MODIFIED /config/cache/ttl
Old: 300
New: 3600
Summary: 4 modified, 1 added, 0 removed
Attribute Change Detection
Document A:
<user id="42" role="viewer" active="true">
<name>Alice</name>
</user>
Document B:
<user id="42" role="admin" active="true" department="engineering">
<name>Alice</name>
</user>
Diff result:
UNCHANGED @id = "42"
MODIFIED @role
Old: viewer
New: admin
UNCHANGED @active = "true"
ADDED @department = "engineering"
Comparing API Responses
API v1 response:
<product>
<id>123</id>
<name>Widget Pro</name>
<price>29.99</price>
</product>
API v2 response:
<product>
<id>123</id>
<name>Widget Pro</name>
<price currency="USD">29.99</price>
<sku>WGT-PRO-001</sku>
<category>tools</category>
</product>
Diff result:
UNCHANGED /product/id = "123"
UNCHANGED /product/name = "Widget Pro"
MODIFIED /product/price — attribute added: currency="USD"
ADDED /product/sku = "WGT-PRO-001"
ADDED /product/category = "tools"
Impact on your parser:
price element now has a currency attribute — update parser
Two new fields available — update data model if needed
Kubernetes Manifest Comparison
deployment-v1.yaml:
<Deployment>
<spec>
<replicas>2</replicas>
<template>
<spec>
<containers>
<image>myapp:1.0.0</image>
<resources>
<memory>256Mi</memory>
</resources>
</containers>
</spec>
</template>
</spec>
</Deployment>
deployment-v2.yaml:
MODIFIED replicas: 2 → 3
MODIFIED image: myapp:1.0.0 → myapp:1.1.0
ADDED cpu: 500m (new resource limit)
MODIFIED memory: 256Mi → 512Mi
View Modes
Tree view:
Shows XML hierarchy with colored indicators
✓ Added (green)
✗ Removed (red)
~ Modified (yellow)
· Unchanged (default)
Side-by-side view:
Document A | Document B
─────────────────── | ───────────────────
<host>localhost</host> | <host>db.prod.com</host>
(highlighted red) | (highlighted green)
Unified view:
- <host>localhost</host>
+ <host>db.production.com</host>
Formatting Differences Are Ignored
Document A (compact):
<config><host>localhost</host><port>5432</port></config>
Document B (formatted):
<config>
<host>localhost</host>
<port>5432</port>
</config>
Diff result: NO DIFFERENCES
(Structural comparison ignores whitespace/formatting)
Common Use Cases
- Comparing XML configuration files between environments (dev/staging/prod)
- Tracking API response changes between versions
- Reviewing XML schema evolution over time
- Auditing configuration changes in enterprise systems
- Debugging XML processing pipelines
- Comparing SOAP request/response pairs