* @return null if no matched or named template found, otherwise
* the next named or matched template at or below the position.
*/
private ElemTemplate getNextMatchOrNamedTemplate(int pos)
{
ObjectStack elems = m_transformer.getCurrentTemplateElements();
for (int i = pos; i >= 0; i--)
{
ElemTemplateElement elem = (ElemTemplateElement) elems.elementAt(i);
if(null != elem)
{
if(elem.getXSLToken() == Constants.ELEMNAME_TEMPLATE)
{
return (ElemTemplate)elem;