For changing the DocumentRoot and Directory follow the steps below,
1.Open the file httpd.conf from the location C:/xampp/apache/conf
2.Search for DocumentRoot and you will get something like this
Update the DocumentRoot to new location. For example, if you want to update the DocumentRoot to D:/www , then you will have the following line after updating the location
3.Then find the Directory and you will fine something similar to
Update it to new location like this
4.Then finally restart the Apache server using XAMPP control panel or manually.
See if these steps help resolve your issue.