Referencing first child and getting object reference error
<p>I have two different XML responses that can be returned. They look like this:</p>

<p>1) Gets returned if no user.</p>

<pre><code>&lt;ArrayUser xmlns:i="http://www.w3.org/2001/XMLSchema-instance"&gt;
</code></pre>

<p>2: Gets returned if user found.</p>

<pre><code>&lt;ArrayUser xmlns:i="http://www.w3.org/2001/XMLSchema-instance"&gt;
  &lt;User&gt;
    &lt;Name&gt;&lt;/Name&gt;
    &lt;ID&gt;&lt;/ID&gt;
  &lt;/User&gt;
</code></pre>

<p>Here is my current code:</p>

<pre><code>        if (userLookupResponse.DocumentElement.FirstChild.Name.Equals("User")) 
        {
            XmlNamespaceManager nsm = addXmlNamespaces(userLookupResponse);
            userLookupResponse.LoadXml(userLookupResponse.SelectSingleNode("//SSO:User", nsm).OuterXml);
            return userLookupResponse;
        }
</code></pre>

<p>My issue is that if a user isn't returned it errors on the <code>if</code> statement with an object reference not set to instance of an object error. How can I go inside the if statement only if number 2 is returned with user information?</p>

<p>Thanks.</p>
