you would use the parseXmlString method and pass it the string data. The above should be re-written as:
var libxmljs = require('libxmljs');
fs.readFile(__dirname + '/foo.xml', function(err, data) {
var doc = libxmljs.parseXmlString(data.toString());
// doc is now your parsed xml
});
cheers,
~Roman