You can use XSLT or you can roll your own, but you need a sequential parser (SAX, for example) and not a DOM based one. You could also use XSLT to make an intermediate file for you and then use that ...