A SOAP API response or a legacy system's config file is often stored as one dense line with no whitespace. Here's why reformatting it helps.
XML is a hierarchy, just like HTML
XML is a tree of nested elements, and which element is a child of which determines the meaning of the data โ a relationship that's completely invisible when everything is jammed into one line.
Where this comes up in practice
This matters when debugging a legacy system's SOAP web service response, checking the structure of an RSS or Atom feed, or reviewing a config file like Maven's pom.xml or Android's AndroidManifest.xml.
Attributes vs. text nodes stay untouched
Reformatting only reveals the element hierarchy โ an attribute inside a tag (the id in <item id="1">) and the text content between tags stay exactly as they were. It's a purely visual cleanup, not a change to the data itself.