lxptree: construct XML trees

Construct an XmlTree from a string or file.

The implementation depends on LuaExpat, an expat binding.

lxptree.parsestring(s)

Return an XML tree parsed from the string s.

lxptree.parsefile(file)

Returns a tree lazily parsed from file. If file is a string, it is interpreted as a filename and opened; otherwise, file is treated as an io library file object.

Note that file is read and parsed as one big chunk, so running this on a 2G file may be a bad idea. On the other hand, building a tree of a 2G file would be a worse idea.