title: Wrap XElement with another XElement
body: <p>I have a collections of XElements that I get like <code>doc.Root.Element("Doc").Elements("PersonalData")</code>.</p>
  
  <p>Collection looks like that:</p>
  
  <pre><code>&lt;PersonalData att1="0" att2="21" att3="2017"&gt;
          &lt;element1&gt;
            &lt;data name="test test test" /&gt;
          &lt;/element1&gt;
          &lt;element2&gt;
            &lt;element3 att1="66725.67" att2="51769.82" &gt;
              &lt;data att1="03" att2="HP"/&gt;
              &lt;data att1="03" att2="HP"/&gt;
              &lt;data att1="03" att2="HP"/&gt;
            &lt;/element3&gt;
          &lt;/element2&gt;
  &lt;/PersonalData &gt;
        &lt;PersonalData att1="0" att2="21" att3="2017"&gt;
          &lt;element1&gt;
            &lt;data name="test test test" /&gt;
          &lt;/element1&gt;
          &lt;element2&gt;
            &lt;element3 att1="66725.67" att2="51769.82" &gt;
              &lt;data att1="03" att2="HP"/&gt;
              &lt;data att1="03" att2="HP"/&gt;
              &lt;data att1="03" att2="HP"/&gt;
            &lt;/element3&gt;
          &lt;/element2&gt;
  &lt;/PersonalData &gt;
  </code></pre>
  
  <p>I'd like to surround each element in collection with <code>&lt;row&gt;</code> element.</p>
  
  <p>I've tried to do it like this:</p>
  
  <pre><code>foreach (var item in doc.Root.Element("Doc").Elements("PersonalData"))
              {
                 item.AddBeforeSelf("&lt;row&gt;");
                 item.AddAfterSelf("&lt;/row&gt;");
              }
  </code></pre>
  
  <p>but except <code>"&lt;"</code> I get <code>&amp;lt &amp;gt</code>.
  Can I fix it somehow or can I do something like:</p>
  
  <pre><code>item.ReplaceWith(new XElement("row").Add(item)); 
  </code></pre>
  
  <p>How can I do it properly?</p>
  
  <p>At the end it should look like:</p>
  
  <pre><code>&lt;row&gt;
  &lt;PersonalData att1="0" att2="21" att3="2017"&gt;
              &lt;element1&gt;
                &lt;data name="test test test" /&gt;
              &lt;/element1&gt;
              &lt;element2&gt;
                &lt;element3 att1="66725.67" att2="51769.82" &gt;
                  &lt;data att1="03" att2="HP"/&gt;
                  &lt;data att1="03" att2="HP"/&gt;
                  &lt;data att1="03" att2="HP"/&gt;
                &lt;/element3&gt;
              &lt;/element2&gt;
      &lt;/PersonalData &gt;
  &lt;/row&gt;
  &lt;row&gt;
  &lt;PersonalData att1="0" att2="21" att3="2017"&gt;
              &lt;element1&gt;
                &lt;data name="test test test" /&gt;
              &lt;/element1&gt;
              &lt;element2&gt;
                &lt;element3 att1="66725.67" att2="51769.82" &gt;
                  &lt;data att1="03" att2="HP"/&gt;
                  &lt;data att1="03" att2="HP"/&gt;
                  &lt;data att1="03" att2="HP"/&gt;
                &lt;/element3&gt;
              &lt;/element2&gt;
      &lt;/PersonalData &gt;
  &lt;/row&gt;
  </code></pre>