<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://www.springframework.org/schema/beans
		https://www.springframework.org/schema/beans/spring-beans-3.1.xsd"
	default-init-method="initMethod1"
	default-destroy-method="destroyMethod1">

	<bean id="beanA" class="org.springframework.beans.factory.xml.InitDestroyBean"/>

	<beans default-init-method="initMethod2" default-destroy-method="destroyMethod2">
		<bean id="beanB" class="org.springframework.beans.factory.xml.InitDestroyBean"/>

		<beans default-init-method="initMethod3" default-destroy-method="destroyMethod3">
			<bean id="beanC" class="org.springframework.beans.factory.xml.InitDestroyBean"/>
		</beans>

		<beans> <!-- should fall back to outer defaults (initMethod2 and destroyMethod2) -->
			<bean id="beanD" class="org.springframework.beans.factory.xml.InitDestroyBean"/>
		</beans>
	</beans>
</beans>
