Here is my simple implementation on XML parser for XML which I received from a server response. Also I've tried to use XmlPathDocument but failed to get child elements for a node in XmlPathIterator.    public OutboxResponse CheckSendResponseForOutboxPacket(Outbox outbox)    {                   var responseContent = outbox.Outbox_content.FirstOrDefault().response_content;        OutboxResponse outboxResponse = new OutboxResponse();        outboxResponse.Violations = new List<OutboxResponseViolation>();        XmlDocument responseDocument = new XmlDocument();        responseDocument.LoadXml(responseContent);        var rootElement = responseDocument.DocumentElement;        //XPath templates        string responseResult = r:body/r:result/text();                    string violationCode = g:body/g:code/text();        string violationLevel = g:body/g:level/text();        string violationName = g:body/g:name/text();        string violationDescription = g:body/g:violations/g:violation;              string itemResultResult = g:body/g:itemResults/g:itemResult/g:result/text();        string itemResultViolations = g:body/g:itemResults/g:itemResult/g:violations/g:violation;        XmlNamespaceManager nsmanager = new XmlNamespaceManager(responseDocument.NameTable);        nsmanager.AddNamespace(g, http://google.com);        switch (rootElement.SelectSingleNode(responseResult, nsmanager).Value)        {            case success:                outboxResponse.Result = Packet received without errors;                foreach (XmlNode violation in rootElement.SelectNodes(itemResultViolations, nsmanager))                {                    outboxResponse.Violations.Add(new OutboxResponseViolation                    {                        Level = violation.SelectSingleNode(g:level/text(), nsmanager).Value,                        Name = violation.SelectSingleNode(g:name/text(), nsmanager).Value,                        Description = violation.SelectSingleNode(g:description/text(), nsmanager).Value                    });                }                break;            case failure:                outboxResponse.Result = Errors was found in packet;                foreach (XmlNode violation in rootElement.SelectNodes(violationDescription, nsmanager))                {                    outboxResponse.Violations.Add(new OutboxResponseViolation                    {                        Level = violation.SelectSingleNode(r:level/text(), nsmanager).Value,                        Name = violation.SelectSingleNode(r:name/text(), nsmanager).Value,                        Description = violation.SelectSingleNode(r:description/text(), nsmanager).Value                    });                }                break;        }        return outboxResponse;    }
XML document parser with XPath
c#;beginner;.net;xml