It's a very simple command line Ruby gem. First, you install it:
And then you ask it to check your XML file, say
If the file is not "pretty,"
xcop will complain and show what's wrong. You can ask
xcop to fix the file:
Moreover, in most cases, you may need your XML files to include a license in their headers, especially if it's open source. To enforce that, just point
xcop to the file with the license:
I believe it's good practice to use
xcop together with Checkstyle (for Java files), Rubocop (for Ruby files), and other static analyzers, to ensure that your XML files always look pretty.