title: Golang XML marshal two identical attributes
body: <p>I'm forced to work with some poorly designed XML, I'm trying to read this XML into a Go structure. Here's some sample data:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;dictionary&gt;
  
      &lt;direction from="lojban" to="English"&gt;
          &lt;valsi word="cipni" type="gismo"&gt;
              &lt;rafsi&gt;cpi&lt;/rafsi&gt;
              &lt;definition&gt;x1 is a bird of species x2&lt;/definition&gt;
              &lt;notes&gt;&lt;/notes&gt;
          &lt;/valsi&gt;
          ...
      &lt;/direction&gt;
  
      &lt;direction from="English" to="lojban"&gt;
          &lt;nlword word="eagle" valsi="atkuila" /&gt;
          &lt;nlword word="hawk" sense="bird" valsi="aksiptrina" /&gt;
          ...
      &lt;/direction&gt;
  
  &lt;/dictionary&gt;
  </code></pre>
  
  <p>My issue is I can either read in  nodes or  because they both contain the attribute "word":</p>
  
  <pre><code>main.NLWord field "Word" with tag "word,attr" conflicts with field "Valsi" with tag "word,attr"
  </code></pre>
  
  <p>I'm starting to think unmarshalling may be the wrong approach as I'd ideally structure the data differently. Should I read the XML in using some other method and build up data structures manually?</p>
  
  <pre><code>type Valsi struct {
      Word  string   `xml:"word,attr"`
      Type  string   `xml:"type,attr"`
      Def   string   `xml:"definition"`
      Notes string   `xml:"notes"`
      Class string   `xml:"selmaho"`
      Rafsi []string `xml:"rafsi"`
  }
  
  //Whoever made this XML structure needs to be painfully taught a lesson...
  type Collection struct {
      From  string  `xml:"from"`
      To    string  `xml:"to"`
      Valsi []Valsi `xml:"valsi"`
  }
  
  type Vlaste struct {
      Direction []Collection `xml:"direction"`
  }
  
  var httpc = &amp;http.Client{}
  
  func parseXML(data []byte) Vlaste {
      vlaste := Vlaste{}
      err := xml.Unmarshal(data, &amp;vlaste)
      if err != nil {
          fmt.Println("Problem Decoding!")
          log.Fatal(err)
      }
      return vlaste
  }
  </code></pre>