Template:If

Description
An alternative to the parser expression that preserves whitespace.

See https://en.wikipedia.org/wiki/Template:If for more complex version where you can use #if, #ifexpr, #ifeq, all in a single template.

Examples
XX →XX

XX →XX