title: Add child to E4X with my variable
body: <p>This is using Mirth Connect which uses E4x and js.</p>
  
  <p>Basically I have a variable that I want to populate the XML with.</p>
  
  <pre><code>var memberid = "1234";
  var fieldsxml = new XML(&lt;fieldvaluelist&gt;&lt;/fieldvaluelist&gt;);
  fieldsxml.field += &lt;fieldvalue templatefieldid="446" value=@memberid/&gt; //memberID
  </code></pre>
  
  <p>But its giving an error on the 3rd line:  (I also tried just memberid without quotes)  </p>
  
  <blockquote>
    <p>DETAILS:  TypeError: Open quote is expected for attribute "value"
    associated with an  element type  "fieldvalue".</p>
  </blockquote>
  
  <p>It works if the third line is this:</p>
  
  <pre><code>fieldsxml.field += &lt;fieldvalue templatefieldid="446" value="memberid"/&gt; 
  </code></pre>
  
  <p>But that just adds the literal string "memberid" .  I actually want value="1234" instead.</p>
  
  <p>How can I do this?</p>
  
  <p>Edit:  The final XML should look like this.</p>
  
  <pre><code>&lt;fieldvaluelist&gt;&lt;fieldvalue templatefieldid="446" value="1234"/&gt;&lt;/fieldvaluelist&gt;
  </code></pre>