title: Most convenient way to unit test Xml/XElement result
body: <p>I have some codes heavily uses <code>XElement</code> class to build segments of Xml, for example code looks like</p>
  
  <pre><code>        XNamespace ns = "ns";
          XElement myXml = new XElement(
              ns + "filter",
              new XElement(
                  ns + "and",
                  new XElement(
                      ns + "equals",
                      new XAttribute("name", "uid"),
                      new XElement(ns + "value", "some text"))));
  </code></pre>
  
  <p>It eventually spits out some Xml code equivalent to </p>
  
  <pre><code>        &lt;ns:filter&gt;
              &lt;ns:and&gt;
                  &lt;ns:equals name="uid"&gt;
                      &lt;ns:value&gt;some text&lt;/ns:value&gt;
                  &lt;/ns:equals&gt;
              &lt;/ns:and&gt;
          &lt;/ns:filter&gt;
  </code></pre>
  
  <p>Now I need to unit test the logic go going through xpath, getting attributes and so on. I can always write my Linq-Xml to check the data, but it is very tedious since I need to unit test quite lot of similar codes.</p>
  
  <p>I looked into <code>fluent assertions</code>, it is very close, but it does not seem to be able to validate nested element's value.</p>
  
  <p>Any one has some good recommendation?</p>