IDEA can validate a web.xml file and it will highlight in red and halt the make if the file doesn't validate. However, for some validation problems the fix is straightforward and it would be nice if the editor could at least tell the user what the fix is, or offer to perform the fix automatically.
For example, this snippet of a web.xml will NOT validate because all the <servlet> elements have to come together; they are not allowed to be mixed up with the <servlet-mapping> elements:
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
...
<servlet>...</servlet>
<servlet-mapping>...</servlet-mapping>
<servlet>...</servlet>
<servlet-mapping>...</servlet-mapping>
...
</web-app>
The editor will highlight the <web-app> tag, though, not the <servlet> or <servlet-mapping> tags (servlet-mapping elements must come after all the servlet elements).
Things that ought to be true:
1) the out-of-place tags ought to be highlighted
2) although the validation failed because the contents of the web-app element are out of order, the error message ought to say what elements are incorrect
3) since the otherwise fine web.xml would validate if the elements were just in the right order, there ought to be an intention to reorder the elements according to the DTD
This becomes more helpful as web.xml grows. I'm a contributor to a web app whose web.xml is over six thousand lines long.