Returning an XmlDocument from XPathNodeIterator
<p>I need some help in returning an XmlDocument object from XPathNodeIterator.</p>

<p>Here is what I was trying to do:</p>

<pre><code>public XmlDocument GetFilteredXML(XmlDocument baseXML, int codeID)
{
    XPathNavigator nav = baseXML.CreateNavigator();
    string xpath = /*some expression based on codeID*/;
    XPathExpression exp = nav.Compile(xpath);
    exp.AddSort(/*do some sorting*/);
    XPathNodeIterator iter = exp.Select(exp);

    // Here how do I return an XmlDocument object from
    // the iterator which contains the selected nodes only?
}
</code></pre>
