For example consider the following xml
<root>
<childNode attribute1="value1">
<grandChildNode attrib1="val1" attrib2="val2">some content1
</grandChildNode>
<grandChildNode attrib1="val1" attrib2="val2">some content2
</grandChildNode>
<grandChildNode attrib1="val1" attrib2="val2">some content3
</grandChildNode>
</childNode>
<childNode attribute1="value1">
<grandChildNode attrib1="val1" attrib2="val2">some content1
</grandChildNode>
<grandChildNode attrib1="val1" attrib2="val2">some content2
</grandChildNode>
<grandChildNode attrib1="val1" attrib2="val2">some content3
</grandChildNode>
</childNode>
<childNode attribute1="value1">
<grandChildNode attrib1="val1" attrib2="val2">some content1
</grandChildNode>
<grandChildNode attrib1="val1" attrib2="val2">some content2
</grandChildNode>
<grandChildNode attrib1="val1" attrib2="val2">some content3
</grandChildNode>
</childNode>
</root>
Would using DOM to get the root node, then cycle through the childNode and grandChildNode be efficient or using XPath expressions to gather the details of the child and grandChild nodes be efficient?