Go XML Improvements

Having used the encoding/xml package quite a bit now, there are a number of improvements I'd like to see.

I think most of these changes belong outside of the standard library. The standard library is striking a difficult balance of supporting many different use cases while maintaining a simple API, safety, adhering to the xml spec, and mapping xml to go. rsc's BUG comment notes the challenge.

Mapping between XML elements and data structures is inherently flawed: an XML element is an order-dependent collection of anonymous values, while a data structure is an order-independent collection of named values. See package json for a textual representation more suitable to data structures.

Finally, one of the neat tricks you can use for unmarshaling arbitrary xml trees is a recursive definition.

type Element struct {
	XMLName  xml.Name
	CharData string     `xml:",chardata"`
	Attrs    []xml.Attr `xml:",any,attr"`
	Elems    []Element  `xml:",any"`
}

Hi, I'm Eddie Scholtz. These are my notes. You can reach me at eascholtz@gmail.com. Atom