title: Best way to construct XML from JSON in Golang
body: <p>I have a middleware where I receive JSON input and with user credentials and needs to grab them to construct a full XML with various other data.</p>
  
  <p>Suppose I have below code to decode JSON:</p>
  
  <pre><code>json.NewDecoder(r.Request.Body).Decode(entityPointer)
  </code></pre>
  
  <p>What is the most efficient way to construct XML from here?</p>
  
  <p>I thought I could just match with struct and use them or parse them with existing XML template and replace the template variables?</p>
  
  <p>if I had for example <code>{username: '11', password: 'pass'}</code> as request, How can I construct below XML out of </p>