There's more...

By default, Python will print XML format in one line; this is also called minification. To reformat the XML to a prettier format, you can write a code to beautify the XML format, either by importing a library that can beautify the XML format or using an online XML beautifier. The following example shows an XML beautifier from https://codebeautify.org/xmlviewer:

Get VMware NSX Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.