I have been trying to extend Spring's xml. I need help with the following scenarios:

1. BeanDefinitionParser for the following
Code:
<myns:component>
  <myns:component>
    <myns:component>
       <myns:component/>
    </myns:component>
  </myns:component>
</myns:component>
I have gone thru the example provide in docs(Appendix B) regarding this, but I need to define the structure in recursive way, where depth of 'component' can be anything.

2. BeanDefinitionParser for the following
Code:
<myns:component>
  <myns:component1/>
  <myns:component2/>
</myns:component>
Say I have defined the BeanDefinitionParser for 'component1' and 'component2' seperately, is there a way to inform the beandefinitionparser of 'component' about it.



Thx in adavance.

(Note: if this is the wrong forum please redirect me to correct one)