Below code is for you to convert XML to PDF by three steps:
using Spire.Doc;
namespace XML2PDf
{
class Program
{
static void Main(string[] args)
{
Document mydoc = new Document();
mydoc.LoadFromFile(@"E:\TestScript\XML2PDf\XML2PDf\sample.xml", FileFormat.Xml);
mydoc.SaveToFile("Test.doc", FileFormat.Doc);
mydoc.SaveToFile("test.pdf", FileFormat.PDF);
System.Diagnostics.Process.Start("Test.pdf");
}
}
}