title: Golang nested, renamed XML attributes
body: <p>Given the following struct:</p>
  
  <pre><code>type book struct {
      XMLName xml.Name   `xml:"DailyAct"`
      Symbol     string  `xml:"TradeInstrId,attr"`
      EntityId   string  `xml:"EntityId,attr"`
      AssetClass string  `xml:"AssetClass,attr"`
      Open       int     `xml:"Open"`
      High       int     `xml:"High"`
      Low        int     `xml:"Low"`
      Close      int     `xml:"Close"`
      // Type      string `` //I'll leave this for another question
  }
  </code></pre>
  
  <p>My current XML: </p>
  
  <pre><code>  &lt;DailyAct EntityId="foo" AssetClass="bar" TradeInstrId="Symbol" &gt;
        &lt;Open&gt;2&lt;/Open&gt;
        &lt;High&gt;3&lt;/High&gt;
        &lt;Low&gt;1&lt;/Low&gt;
        &lt;Close&gt;5&lt;/Close&gt;
    &lt;/DailyAct&gt;
  </code></pre>
  
  <p>But, I need to repurpose certain fields of the struct (or generate xml another way) to achieve:</p>
  
  <pre><code>&lt;DailyAct EntityId="foo" AssetClass="bar" TradeInstrId="Symbol"&gt;
    &lt;Open Price="2" Type="IND"/&gt;
    &lt;High Price="6" Type="IND"/&gt;
    &lt;Low Price="1" Type="IND"/&gt;
    &lt;Close Price="4" Type="IND"/&gt;
  &lt;/DailyAct&gt;
  </code></pre>
  
  <p>But I get: <code>&amp;errors.errorString{s:"xml: DailyAct&gt;Open chain not valid with Price,attr flag"} (actual)</code> when I try to nest fields like so:</p>
  
  <pre><code>type book struct {
      //...
      Open       int     `xml:"DailyAct&gt;Open,Price,attr&gt;"`
      //...
  }
  </code></pre>
  
  <p><strong>Edit:</strong> 
  I found this <a href="https://github.com/golang/go/issues/3688" rel="nofollow">discussion</a>, while googling around so what I'm going for may not be feasible currently </p>