- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
public static XmlNode FindNodeRecursive(XmlNode document, string nodeName)
{
if (document.Name == nodeName)
return document;
foreach (XmlNode node in document.ChildNodes)
{
if (node.Name == nodeName)
return node;
XmlNode resNode = FindNodeRecursive(node, nodeName);
if (resNode != null && resNode.Name == nodeName)
return resNode;
}
return (XmlNode)null;
}
<...>
XmlDocument document = new XmlDocument();
document.LoadXml(request);
var PurchaseIdNode = XmlProcessing.FindNodeRecursive(document, "PurchaseId");