You have probably seen forgotten merge code, a faulty ctrl+s that has stored a s in an xml file, an accidental copy/move of code when scrolling with mouse, which have been found after code pushed to server when something isn’t working correctly. Code is compiled and will give you a compile error, but XML won’t, and a lot of systems today rely heavily on XML configuration
I have the habit of putting the “xml-maven-plugin” plugin to my maven projects which makes XML code to be validated every time it builds, this way I can be sure that nothing has been accidentally added to a file.
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>xml-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>validate</goal>
</goals>
</execution>
</executions>
<configuration>
<validationSets>
<validationSet>
<dir>src/main/resources</dir>
<includes>
<include>struts.xml</include>
<include>register-user-flow-struts.xml</include>
</includes>
</validationSet>
<validationSet>
<dir>src/main/webapp/WEB-INF</dir>
<includes>
<include>applicationContext.xml</include>
<include>web.xml</include>
<include>portlet.xml</include>
</includes>
</validationSet>
</validationSets>
</configuration>
</plugin>