1.
if(filePaths.Any(filepath => Path.GetExtension(filepath) != @".xml"))
throw new ArgumentException(...);
2.
string args = string.Join(" ", filePaths.ToArray());
or, with LINQ (much more inefficient):
string args = filePaths.Aggregate("", (combined, path) => combined + " " + path);
source
share