title: How can I generate a dynamic tag with Nokogiri::XML::Builder?
body: <p>I am looping through a set of tag names in an array, and I want to print each one using builder without resorting to the manual XML of the "&lt;&lt;" method.</p>
  
  <p>I thought that:</p>
  
  <pre><code>builder = Nokogiri::XML::Builder.new do |xml|
  
    for tag in tags
      xml.tag! tag, someval
    end
  end
  </code></pre>
  
  <p>would do it, but it just creates tags with the name "tag", and puts the tag variable as the text value of the element.</p>
  
  <p>Can anyone help? This seems like it should be relatively simple, I have just had trouble finding the answer on search engines. I am probably not asking the question the right way.</p>