g | x | w | all
Bytes Lang Time Link
032Perl 5250327T155541ZXcali
015Japt h170920T131231ZShaggy
013Pyth180310T032859Zhakr14
082C gcc180803T221558ZJonathan
029plain TeX170921T110334ZManuel
035PowerShell170920T130113ZAdmBorkB
012SOGL V0.12170920T130317Zdzaima
012Jelly170920T154843ZErik the
01305AB1E170920T154703ZErik the
032Python 2170920T150729ZErik the
037JavaScript ES6170920T125617ZNeil
2120MATL170920T141304ZCinaski
01705AB1E170920T140616ZEmigna
167Java OpenJDK 8170920T131124ZRoberto
040Wolfram Language Mathematica170920T123802ZVitaliy

Perl 5, 32 bytes

s/x|^$/{x^x_x}/g while$b++<5;say

Try it online!

Japt -h, 21 20 18 16 15 bytes

The 5 at the beginning can be removed to be able to take the level as input.

5Æ="\{^_}"¬qUgx

Test it

Outdated Explanation

5Æ="\{^_}"¬qUª'x
5Æ                   :Map the range [0,5)
  =                  :  Assign to variable U
   "\{^_}"           :    Literal string (the "{" is escaped as it's used for string interpolation in Japt)
          ¬          :    Split
           q         :    Join with
            Uª'x     :      Logical OR of U (initially 0) and "x"
                     :Implicit output of last element

Pyth, 17 16 13 bytes

jF+\x*5]"{^_}

Try it online!

Python 3 translation:
from functools import*;print(reduce(lambda x,y:x.join(y),["x"]+5*["{^_}"]))

C (gcc), 82 bytes

O(o){o--?_(125,O(o,_(95,O(o,_(94,O(o,_(123))))))):_(120);}main(){O(5);}

Try it online!

plain TeX, 29 bytes

\def~#1x{{#1x_#1x^#1x}}~~~~~x

That outputs what others have output. But if we need the code to be compilable it would be 6 bytes more

\def~#1x{{#1x_#1x^#1x}}$~~~~~x$\bye

Explanation

~ is an active character in TeX, so we can give it a (new) definition.

\def~#1x{{#1x_#1x^#1x}} defines ~ as a macro, so that when TeX sees ~, it does the following:

For example, ~ABCx would get replaced with {ABCx_ABCx^ABCx}.

When ~~~~~x is used, #1 is ~~~~, so the whole thing gets replaced with {~~~~x_~~~~x^~~~~x}. And so on.

Once we have the long string, we can print it out to terminal with \message (and ending with a \bye so TeX stops), so \message{~~~~~x}\bye. Or typeset the resulting expression (as a mathematical formula), by surrounding it in $s : so $~~~~~x$\bye.

PowerShell,  44  35 bytes

"'x'"+"-replace'x','{x^x_x}'"*5|iex

Try it online!

Uses string multiplication to repeatedly -replace xes with the sub- and super-scripts, then output.

Saved 9 bytes thanks to Joey.

SOGL V0.12, 16 12 bytes

 x5{"{^_}”;∑

Try it Here!

Port of Erik The Outgolfer's Python 2 answer

Jelly, 12 bytes

”x“{^_}”j$5¡

Try it online!

Port of my Python 2 answer.

05AB1E, 13 bytes

'x5F"{^_}"Ssý

Try it online!

Port of my Python 2 answer.

Python 2, 32 bytes

exec"print'x'"+".join('{^_}')"*5

Try it online!

JavaScript (ES6), 45 42 37 bytes

f=n=>n>4?'x':[...'{^_}'].join(f(-~n))

Edit: Saved 3 2 bytes thanks to @Arnauld. Specifying 5 still costs me 2 bytes; this 41 40 35-byte version takes a parameter instead:

f=n=>n?[...'{^_}'].join(f(n-1)):'x'

MATL, 21 20 bytes

'x'XJ5:"J'{x^x_x}'Zt

-1 byte thanks to Giuseppe

Try it online!

05AB1E, 17 bytes

'x5F'x¡"{x^x_x}"ý

Try it online!

Explanation

'x                  # push "x"
  5F                # 5 times do
    'x¡             # split on "x"
       "{x^x_x}"ý   # join on "{x^x_x}"

Other programs at the same byte-count include

"{x^x_x}"©4F'x¡®ý
'x5F'x"{x^x_x}".:

Java (OpenJDK 8), 179 167 bytes

@Neil port

interface Y{static void main(String[]a){System.out.println(t.apply(1));}java.util.function.Function<Integer,String>t=N->N>0?Y.t.apply(N-1).replace("x","{x^x_x}"):"x";}

Try it online!

Wolfram Language (Mathematica) - 40 characters

Summarizing 3 best answers here:

40 bytes:

Nest["{"<>#<>"_"<>#<>"^"<>#<>"}"&,"x",5]

41 bytes:

Nest[StringReplace["x"->"{x^x_x}"],"x",5]

44 bytes:

Last@SubstitutionSystem["x"->"{x^x_x}","x",5]