TikZ
Not exactly sure which library you're referring to, but the general procedure applies.
If you have \usetikzlibrary{shapes.gates.logic.IEC}, then this loads the file tikzlibraryshapes.gates.logic.IEC.code.tex which is found (in my system) in /usr/local/texlive/2015/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/. You can find the location by running kpsewhich tikzlibraryshapes.gates.logic.IEC.code.tex in a terminal.
This file sets up some styles, and loads pgflibraryshapes.gates.logic.IEC.code.tex (which is in the folder .../texmf-dist/tex/generic/pgf/libraries/shapes/circuits/), and this is where the actual code for the gates are found. The or gate IEC is defined from line 343 onwards.
circuitikz
Assuming you're actually talking about circuitikz, and not tikz.
As far as I can see, without being very familiar with circuitkz, the definition of european xor gate, as demonstrated in runartrollet's answer, can be found in the file pgfcirctripoles.tex. As above, you can find the location of this with kpsewhich pgfcirctripoles.tex, I have it in /usr/local/texlive/2015/texmf-dist/tex/generic/circuitikz/pgfcirctripoles.tex.
The different types of gates are made with a macro called \pgfcircdeclareeurologicport, which is defined in lines 892--1022 of said file. (See the lines immediately below the macro definition.)