private void Parse(XPathNavigator navigator, bool fromAppConfig) { ParseByteCodeProvider(navigator, fromAppConfig); ParseReflectionOptimizer(navigator, fromAppConfig); XPathNavigator xpn = navigator.SelectSingleNode(CfgXmlHelper.SessionFactoryExpression); if (xpn != null) { sessionFactory = new SessionFactoryConfiguration(navigator); } else { if (!fromAppConfig) { throw new HibernateConfigException("<session-factory xmlns='" + CfgXmlHelper.CfgSchemaXMLNS + "'> element was not found in the configuration file."); } } }