Populating and XML template with LINQ to XML?

xhulio

New Member
I have multiple XML templates and I would like to populate them using LINQ to XML, but I wasn't sure how to get started, meaning how to correctly read in the XML file (Best method) and populate attributes and Nodes (InnerText). Also, how do create new elements and attributes in the existing template as well remove/update existing ones? Here is an example of a template:\[code\]<Person age="age"><FirstName></FirstName><LastName></LastName><Children><Name></Name></Children></Person>\[/code\]In the abvoe, the age attribute is a placeholder, FirstName, LastName and Name under Children are placeholders. Let's also assume that I either want to remove Names under children or add names as well. Also lets assume I want to add a DOB element inside Person with day, month, year attributes?
 
Back
Top