Concept of xml files for haar cascade in object detection with opencv?
XML files are generated when you train the Haar Cascade Classifier. From the OpenCV docs:

Object Detection using Haar feature-based cascade classifiers is an effective object detection method proposed by Paul Viola and Michael Jones in their paper, &quot;Rapid Object Detection using a Boosted Cascade of Simple Features&quot; in 2001. It is a machine learning based approach where a cascade function is trained from a lot of positive and negative images. It is then used to detect objects in other images

More information on Haar cascades can be found here.
Some tutorials for training Haar Cascades are available.

Link 1
Link 2
Link 3