title: Golang how parse into xml exception dynamically
body: <p>I have some code. I want get elem NoSessionException dynamically, because I have few xml responses with different exceptions. How can I to do it?</p>
  
  <pre><code>package main
  
  import (
      "encoding/xml"
      "fmt"
  )
  
  
  type E struct {
          XMLName xml.Name `xml:"Envelope"`
          Body    struct {
              F MfcFaultType `xml:"Fault"`
          }
      }
  
  
  type MfcFaultType struct {
      FaultCode   string `xml:"faultcode"`
      FaultString string `xml:"faultstring"`
      Detail string `xml:"detail&gt;ns2"`
  }
  
  
  var data = []byte(`&lt;S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"&gt;
     &lt;S:Body&gt;
        &lt;S:Fault xmlns:ns4="http://www.w3.org/2003/05/soap-envelope"&gt;
           &lt;faultcode&gt;S:Server&lt;/faultcode&gt;
           &lt;faultstring&gt;ffffffff&lt;/faultstring&gt;
           &lt;detail&gt;
              &lt;ns2:NoSessionException message="fffffff." xmlns:ns2="http://webservice.booking.booking.avilex.ru/"/&gt;
           &lt;/detail&gt;
        &lt;/S:Fault&gt;
     &lt;/S:Body&gt;
  &lt;/S:Envelope&gt;`)
  
  func main() {
  
      var q E
      xml.Unmarshal(data, &amp;q)
      fmt.Println(q)
  }
  </code></pre>
  
  <p>I try to generate different structures but I want to find beautiful decision</p>