public XmlSchema GetSchema(string ns, string e1, string e2)
{
string xsd = String.Empty;
if (ns.Equals(String.Empty))
xsd = "<schema xmlns='http://www.w3.org/2001/XMLSchema'><element name='" + e1 + "'/><element name='" + e2 + "'/></schema>";
else
xsd = "<schema xmlns='http://www.w3.org/2001/XMLSchema' targetNamespace='" + ns + "'><element name='" + e1 + "'/><element name='" + e2 + "'/></schema>";
XmlSchema schema = XmlSchema.Read(new StringReader(xsd), null);
return schema;
}