SAXReader xmlReader = this.getSAXReader();
Document document = xmlReader.read(outputXml);
// Validate the Generator and that it does have arguments
XPath xpath = DocumentHelper.createXPath("//hibernate-mapping/class/id/generator");
List list = xpath.selectNodes(document);
assertTrue("Expected to get one generator element", list.size() == 1);
Attribute genAtt = ( (Element)list.get(0) ).attribute("class");
assertEquals("Unexpected generator class name", "org.hibernate.id.TableHiLoGenerator", genAtt.getStringValue() );
xpath = DocumentHelper.createXPath("//hibernate-mapping/class/id/generator/param");
list = xpath.selectNodes(document);
assertEquals("Expected to get correct number of generator param elements", 2, list.size() );
Element tableElement = (Element)list.get(0);
Attribute paramTableAtt = tableElement.attribute("name");
Element columnElement = (Element)list.get(1);
Attribute paramColumnAtt = columnElement.attribute("name");