Hey! I hate to come back to this but I realized a slight problem... Whenever the "Master_Node" is changed, all the fields clear (if the "Sub_Node_Checker" is equal to "true"). I believe this is due to the fact that the "Sub_Node" field recalculates on change. Since the "Master_Node" is a part of the default expression, it forces the field to re-evaluate, do the fancy "multiple by 0" trick and then reverts itself to a blank state.
I tried using the pipe operator with two substring functions, but apparently InfoPath (or XPath) wants valid nodes targeted on each side (NodeA[condition] | NodeB[condition]) and isn't happy with a "substring" function. I also tried concatenating two substring functions together, but due to the self-reference and the re-calculation of the field at each change InfoPath ends up in an infinite loop (well, dies at 16 calculations).
Here is my hacked together substring function:
concat(substring(../../my:Master_Node, 1, (../my:Sub_Node_Checker != "true") * string-length(../../my:Master_Node)), substring(../my:Sub_Node, 1, (../my:Sub_Node_Checker != "false") * string-length(../my:Sub_Node)))
Is there a way to keep the field from clearing when the Master_Node value is changed? I tried making my Pipe operator version work again, but it just doesn't want to cooperate.