File outputXml = new File(getOutputDir(), getBaseForMappings() + "Group.hbm.xml");
SAXReader xmlReader = this.getSAXReader();
Document document = xmlReader.read(outputXml);
XPath xpath = DocumentHelper.createXPath("//hibernate-mapping/class");
List list = xpath.selectNodes(document);
assertEquals("Expected to get one class element", 1, list.size());
Element node = (Element) list.get(0);
assertEquals(node.attribute( "table" ).getText(),"`Group`");
xpath = DocumentHelper.createXPath("//hibernate-mapping/class/composite-id");
list = xpath.selectNodes(document);
assertEquals("Expected to get one composite-id element", 1, list.size());
xpath = DocumentHelper.createXPath("//hibernate-mapping/class/composite-id/key-property");
list = xpath.selectNodes(document);
assertEquals("Expected to get two key-property elements", 2, list.size());
node = (Element) list.get(0);
assertEquals(node.attribute( "name" ).getText(),"name");
node = (Element) list.get(1);
assertEquals(node.attribute( "name" ).getText(),"org");