Beans are just plain objects, so you can always take an object instantiated by BeanFactory 1 and pass it to a method of an object instantiated by BeanFactory 2.
If, on the other hand, you want to have configuration for XmlBeanFactory 2 like this:
where "bean1" is defined in XmlBeanFactory 1, then this kind of configuration will only work if XmlBeanFactory 1 is a parent to XmlBeanFactory 2. That is, if XmlBeanFactory 2 was created like this:
<bean name="bean2" class="Bean2">
<property name="field" ref="bean1"/>
For details, see http://static.springsource.org/sprin...ns-ref-element
XmlBeanFactory beanFactory2 = new XmlBeanFactory(xmlConfig2, beanFactory1);