title: golang xml parsing dynamic tag names
body: <p>I must parse the xml output of an legacy system where they for some reason thought that it will be smart to add the IDs of values as tag names.</p>
  
  <p>Like so:</p>
  
  <pre><code>&lt;ValueList&gt;
    &lt;ArraySize&gt;2&lt;/ArraySize&gt;
    &lt;v89BNZMpdlWXkuv&gt;value1&lt;/v89BNZMpdlWXkuv&gt;
    &lt;v89N83oCrGhI7jh&gt;value2&lt;/v89N83oCrGhI7jh&gt;
  &lt;/ValueList&gt;
  </code></pre>
  
  <p>I want to parse it to a struct like this:</p>
  
  <pre><code>type ValueList struct {
      Values []Value
  }
  
  type Value struct {
      ID string
      Value String
  }
  </code></pre>
  
  <p>I've started using the custom unmarshal function </p>
  
  <pre><code>func (vl *ValueList) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
      ...
  }
  </code></pre>
  
  <p>and getting the tokens from the <code>xml.Decoder</code>, but that is ugly. Is there a better way?</p>