public override bool TryGetMember(GetMemberBinder binder, out object result) { var newXml = _xml.Element(binder.Name); result = new DynamicXml(newXml); return(newXml != null); }
private static IEnumerable <Person> ReadXmlDynamic() { dynamic document = new DynamicXml("people.xml"); foreach (var record in document.Records) { yield return(new Person { Name = record.Name, Country = record.Country }); } }