Then instead of this:
new XElement("Barcode", Form1.GetStrings(1).Select(i => new XElement("Barcode", i)))
Use your query directly like this, don't create an extra Barcode
element:
Form1.GetStrings(1).Select(i => new XElement("Barcode", i))
Then your code should look like this:
XElement xml = new XElement("people",
from p in people
select new XElement("person", new XAttribute("Id", "Hello"),
new XElement("id", p.Id),
new XElement("Mrp", my.Contains(1) ? string.Join(",",my):"Nitin"),
Form1.GetStrings(1).Select(i => new XElement("Barcode", i))
));
That will give you the expected output.