Since your file in _layouts directory, why not to use GetGenericSetupPath method? Something like this:
var path = SPUtility.GetGenericSetupPath(@"TEMPLATE\LAYOUTS\MyPoject\data.xml");
UPD:
For SharePoint 2013 thisThis method is obsolete in SharePoint 2013, and you should use GetCurrentGenericSetupPath or GetVersionedGenericSetupPath
Thanks for noticing that fact in comments.