Ok, so the web.xml custom parser is "done". It probably has bugs. I'm now looking at doing either .dtd or jboss-web.xml. And I looked in detail at the jboss-web schema, where it looks like my parser will not be able to avoid code duplication. For the generator based impl, it looks worse, as I don't see how to avoid complete duplication, which would make using the metadata API much more painful. Any ideas ?