I want to bind my UI against a collection of XElements and their properties on a webpage. Hypothetically, this could be for any object that represents an XML tree. I'm hoping that there might be a better way of doing this.
Should I use an XPath query to get out the elements of the collection and the attribute values of each (in this case) XElement? Is there a type of object that is designed to ease databinding against XML?
<% foreach(var x in element.Descendants())
{%>
<%= DateTime.Parse(x.Attribute["Time"]).ToShortDate() %>
<% } %>
<%-- excuse me, I just vomited a little in my mouth --%>