Try XML Tools. Plugins -> XML Tools -> Pretty Print (libXML) or (XML only - with line breaks Ctrl + Alt + Shift + B)
You may need to install XML Tools using your plugin manager in order to get this option in your menu.
In my experience, libXML gives nice output but only if the file is 100% correctly formed.
Answer from erjiang on Stack OverflowTry XML Tools. Plugins -> XML Tools -> Pretty Print (libXML) or (XML only - with line breaks Ctrl + Alt + Shift + B)
You may need to install XML Tools using your plugin manager in order to get this option in your menu.
In my experience, libXML gives nice output but only if the file is 100% correctly formed.
You need to install XML Tools from the Plugins menu item → Plugins Admin... → Plugins Admin dialog appears and then scroll to bottom of available plugins and check XML Tools, install it and then Ctrl + Alt + Shift + B OR the option for XML Tools above shows up.