Hi Amar,
I am also getting same error as yours if I don't add slashes before "if" and "end-if"
With those slashes I get "'if (result.value' is not a valid node type name."
I have tried both jboss-as-7.1.1.Final and jboss-eap-6.0, same result.
Have you got any clue?