从XML字符串生成XML模式

我有一个XML字符串,我想加载到Excel工作表。 我几乎让它工作,但我需要能够生成传递给XmlMaps.Add的架构:

String xml; //This is already populated with an XML String; I want to get the schema based on the xml structure Workbook w = Globals.ThisAddIn.Application.ActiveWorkbook; w.XmlMaps.Add(***Need schema here***, "root node"); 

是否可以在此以编程方式生成架构? 我从Web服务接收此XML字符串。