My friend had a question " As Allah created Man and woman then why it feels like woman or man soul is trapped in a wrong body? Its like by physically, a man looks like a man but by soul he doesn't feel like a man at all infact he more feel like a woman. He wants to dress or live like a woman. Want to marry a man instead of woman. Similarly he sexually do not feel towards opposite gender. Is this some biological fault? Or psychological? What he should do to actual feel like a man

According to the scientific material that I have read, soul has nothing to do with such, the soul is the power of intellect and our base of self. Even some described it as genderless, however soul is studied under philosophy.
Gender is studied under psychology, sex is studied under biology. And combination of sex and gender is studied in psychology and physiology.

So odd gender sensations that means sex does not correspond the gender are fixed by psychology because these are psychological problems. And problems in Islam are tests in Islam to see whether a human solves it rightly or disobeys Allah swt in it. So by exhorting efforts and proper psychological treatment and Duas every thing can be fixed. Many of those I know have such problems and now they are straight.