XGrammar: Flexible and Efficient Structured Generation Engine for Large Language Models