Well, as you noticed, the root element of the Hibernate XML configuration file should declare one and only one element <session-factory>according to the DTD:
<!ELEMENT hibernate-configuration (session-factory,security?)>
So, if you want to set up multiple session factories, follow these steps:
References