Xanthurenic acid is a metabolite produced in the body during the breakdown of the essential amino acid tryptophan. It is formed through the action of an enzyme called tryptophan oxygenase, which converts tryptophan into N-formylkynurenine, which is then further broken down to xanthurenic acid.