WOW! lot of questions in that post.....let me try....
Example # 1
//DDD/BBB For all DDD elements, select the BBB child, if any.
/DDD//BBB For the /DDD (root) element, select all the BBB decendant elements (child, grand-child, grand-grand child BBB elements).
Example # 2
//AAA/BBB
/AAA//BBB These are same as Example 1.
//BBB Select all the BBB elements (irrespective of who the parent is) in the document.
I think (not sure) that we will get same out put from all three expressions. Even if we get same out put but I don�t know why? It all depends on the input file. Its possible to get different output, depending on how your file is.
Example # 3
//AAA/BBB/CCC For all AAA elements, select the grand child CCC element whose parent is BBB.
/AAA/BBB//BBB Select all BBB elements whose immediate parent is BBB, whose immediate parent is AAA.
Example # 4
/AAA/BBB/CCC// You haven't selected anything ?
/AAA/BBB/BBB//* Select all decendants of the element "/AAA/BBB/BBB".
Its like walking down a hirearchy....say the way you find a file /jranch/usr/vsaxena/xml/cert/example1.xml on a unix machine or say C:\jranch\use\vsaxena\xml\cert\*.
If you would like, we could take each example and try it with an example file. That will definetly help. I don't know any tools other than writing a style sheet and running it on an example file.
Hope this helps.
- madhav