I think the problem is that text() will only give you the text value, so that the substring function will not even find the <, however you define it. the value of text() of <xyz/> is empty, I believe.
Maybe
you should try to get all the nodes by combining * and text()? and then go thru each node, if a node has a local-name() is input_text, then insert your html code. In this way, you avoid using substring() etc, which is not that reliable in case that you add more nodes in.
Hope it helps.
Tony