I think something like this could work well:
$xml(file,level1,level2,level3)
This would get data from <level1><level2><level3>data</level3></level2></level1>
$xml(file,level1,level2,level3,attrib).attribute
This would get data from <level1><level2><level3 attrib="data" /></level2></level1>