Unable to integrate with salesforce and sql. I want to create an authentication details in xml file. can i authenticate xml file with login credentials using apex and connect to sql by uploadin in salesforce .
If I read the question correctly - you want to connect to a SQL database from Salesforce with Apex using credentials stored in an XML file.
Given that interpretation, then no, you can not do it. Apex can't directly callout to your SQL database.
If you want to integrate with external data in Salesforce you will need to work with a web based API. It could be REST or SOAP based.