The XML file contains the bean configurations, where information on how to create an instance, and how to set values of all the dependencies of the bean will be provided. Using Java Reflection API, the Spring container locates the bean class, invokes the default or parameterized constructor, and ultimately, creates an instance of a bean with the initialization of data members.