#!/usr/bin/env python

from lxml import etree

ns = {"cml":"http://www.xml-cml.org/schema"}

doc = etree.parse("siesta.xml")

energy = doc.xpath("//cml:module[last()]/cml:propertyList/cml:property[@dictRef='siesta:Etot']/cml:scalar/text()", ns)

print energy
