Use XPath! 

//BBB[@id='b1']
//CCC/*
/AAA/BBB[last()]