// Find all <servlet> entries to discover name to class mapping.
List classes = doc.selectNodes("//servlet");
Map<String, Class> classMap = new HashMap<String, Class>();
for (int i = 0; i < classes.size(); i++) {
Element servletElement = (Element)classes.get(i);
String name = servletElement.element("servlet-name").getTextTrim();
String className = servletElement.element("servlet-class").getTextTrim();
classMap.put(name, finder.loadClass(className, component));
}
// Find all <servelt-mapping> entries to discover name to URL mapping.
List names = doc.selectNodes("//servlet-mapping");