A really quick way to format your XML – use Notepad++ with the ‘XML Tools’ plug in

What someone asked me was to make the xml readable, and I needed it last week too. The term is called “pretty print” and that is the function or procedure that needs to be performed on the text to make it work.

What I use is Notepad++ with the tool plugin called “XML Tools”. Simply

  • download Notepad++
  • do the updates it recommends (it will restart)
  • click the menu Plugins->Plugin Manager->Show Plugin Manager
  • scroll down to XML Tools, check it and click Install ( if you already have it it might be the Installed tab)
  • Then perhaps after a restart
    • paste in your xml text (it must validate – which is one draw back about this tool – but that can be solved by a gazzillion online validators assuming your data is not too private (try this, or this, or this – sometimes all 3 will do the trick believe it or not. Fiddle with the options too.)
    • highlight the text (not sure if that is necessary but I do it and it works) then
    • choose the menu item Plugins->XML Tools->Pretty Print (XML Only with line breaks)
      • feel free to experiment with the other kinds.