Check out example codes for "c# generate xml from xsd at runtime". It will help you in understanding the concepts better.

Code Example 1

public XmlDocument GenerateEmptyPdfTemplate(GenerateEmptyPdfTemplateDto generateEmptyPdfTemplateDto)
{
  XmlDocument doc = new XmlDocument();

  XmlSchemaSet schemaSet = new XmlSchemaSet();
  // generateEmptyPdfTemplateDto.XsdDocument <--string xsd
  schemaSet.Add(null, XmlReader.Create(new StringReader(generateEmptyPdfTemplateDto.XsdDocument)));

  schemaSet.Compile();


  XmlSampleGenerator generator = new XmlSampleGenerator(schemaSet, new XmlQualifiedName("foo"));
  generator.MaxThreshold=1;
  doc = new XmlDocument();
  using (XmlWriter writer = doc.CreateNavigator().AppendChild())
  {
    generator.WriteXml(writer);
  }

  return doc;
}

Learn ReactJs, React Native from akashmittal.com