#!/usr/bin/env python

from lxml import etree
from pylab import *

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

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

stepIndices = doc.xpath("/cml:cml/cml:module[@role='step']/@serial", ns)
energies = doc.xpath("/cml:cml/cml:module[@role='step']/cml:propertyList/cml:property[@dictRef='siesta:E_KS']/cml:scalar/text()", ns)

print len(energies)
print len(stepIndices)

plot(stepIndices, energies)
show()
