Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 1,000,000+ packages pre-installed, including xmljs with all npm packages installed. Try it out:

var xmljs = require("xmljs")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

xmljs v0.3.2

A small and simple package which can traverse a XML document

Build Status

A small and simple package which can traverse a XML document. Uses sax-js to parse xml.

The goal of the package is a easy way to navigate and search through xml documents. This package makes is easier to extract data from XML documents.


var XmlParser = require("xmljs");
var fs = require("fs");

var p = new XmlParser({ strict: true });
var xml = fs.readFileSync("./SOAP1.xml"); // XML in the examples direct
var xmlNode = p.parseString(xml, function(err, xmlNode) {
    if(err) {
    var nodes = xmlNode.path(["Envelope", "Body", "GetstockpriceResponse", "Price"], true);
    console.log( { return n.text; }));


<?xml version="1.0"?>

  <soap:Body xmlns:m="">

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free