Use this when automation works with XML such as NETCONF.
XML
XML is a markup format with nested elements and attributes, used by NETCONF, SOAP, Windows configs and many enterprise systems. It supports schemas and namespaces but is verbose.
1. XML: elements, attributes, namespaces.
2. Used by NETCONF, SOAP, many enterprise tools.
3. Parse with safe parsers (XXE).
4. Validate with XSD.
5. Mind namespaces in XPath.
XML → safe parser → tree → XPath
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Effective-state and workload closure Verify boundary
Local intent: XML reference under Data Formats in the Automation Domain.
Step 2 Verification path Verify boundary
The negative fixture should deliberately exercise risks such as encoding/BOM issues, delimiter/quoting ambiguity, duplicate keys, namespace drift, scalar coercion, invalid schema assumptions and parser success without consumer-valid semantics, choosing the cases most relevant to XML syntax/namespace/encoding plus schema/consumer expectations; preserve qualified names and distinguish well-formedness from application validity.
Step 3 Branching troubleshooting Narrow the fault
Path: Automation → Data Formats → XML. Local intent: XML reference under Data Formats in the Automation Domain.
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
Subtopics
Go one level deeper into this subject.
XML elements are the tagged building blocks of a document, such as <hostname>r1</hostname>, which can contain text, attributes and child elements in a tree.
Subtopic AttributesXML attributes are name-value pairs inside an element's start tag, such as <interface name="Gi1">.
Subtopic XPathXPath selects nodes in an XML document with path expressions, such as //interface[name='Gi1']/enabled.
Subtopic ParsingParse XML with a proper library — [xml] or Select-Xml in PowerShell, lxml or ElementTree in Python — taking care of namespaces, which NETCONF replies always use.
- XML has elements, attributes and namespaces.
- NETCONF and many enterprise APIs use XML.
- Never parse XML with regex.
xmllint --noout file.xml— well-formedxmllint --schema schema.xsd --noout file.xml— XSD validationxmllint --xpath '//interface/name/text()' file.xml— XPath query
ReferenceWhy it matters1 section · depth on demand
Internals and state
Local intent: XML reference under Data Formats in the Automation Domain.
ReferenceImportant terms & boundaries2 sections · depth on demand
Mechanics
The linked authority for bounded mechanics is W3C — Extensible Markup Language (XML) 1.0; documentation support is separate from observed lab/production Evidence.
In depth
XML represents data as nested elements with optional attributes and namespaces. It is more verbose than JSON but supports schemas (XSD), namespaces and mixed content, and remains common in NETCONF, SOAP APIs, enterprise systems and many vendor exports.
<device name="sw-oslo-07" xmlns="urn:example:inventory">
<vlan id="20"><name>USERS</name></vlan>
</device>
Things to know when automating:
- Namespaces are part of element names; queries must include them.
- Attributes vs elements: both carry data; check where values live.
- Use a real parser (ElementTree, lxml, PowerShell
[xml]), never regular expressions. - Disable external entity resolution when parsing untrusted XML (use
defusedxmlin Python).
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Data Formats > XML. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://www.w3.org/TR/xml/ · confidence 94%Deep reference
Healthy vs suspicious evidence
Output interpretation
For XML syntax/namespace/encoding plus schema/consumer expectations; preserve qualified names and distinguish well-formedness from application validity, prefer typed fields and stable IDs over human presentation text.