This prior post demonstrated a very simple technique for writing to an XML file that has a set of elements. This post extends that example showing how to write an XML file that has both elements and attributes. Here is the XML file created by this example:
Baggins Bilbo