Get the imported template element based on the given template name.

@inner
@param {Object} tplFile the imported template file
@param {string} name the template name to use
@return {?Object}
function getImportTemplateElement(tplFile, name) {
    if (!name) {
        return;
    }

    let ast = tplFile.ast;
    if (!ast) {
        ast = tplFile.ast = parseDom(tplFile.content.toString());
    }

    let children = ast.children;
    for (let i = 0, len = children.length; i < len; i++) {
        let node = children[i];
        if (node.type === 'tag' && node.name === 'template') {
            let {attribs: attrs} = node;
            if (attrs && attrs.name === name) {
                return node;
            }
        }
    }
}