title: Parse XML from Sonos
body: <p>I am trying to parse the XML output from Sonos subscription I am doing this in Node.js
  I have tried two different npm modules, xml2js and libxmljs but i cant seem to get it right.
  All example that I have find is a simple XML but I am trying to parse a more advanced file and probably not much harder when you know how to handle it.</p>
  
  <p>I hope someone could help me so that I understand how to tackle a file like this.
  In my example then I want the value 22 from:</p>
  
  <pre><code>&lt;Volume channel="Master" val="22"/&gt;
  </code></pre>
  
  <p>Here is the XML file</p>
  
  <pre><code>&lt;e:propertyset
  xmlns:e="urn:schemas-upnp-org:event-1-0"&gt;
  &lt;e:property&gt;
      &lt;LastChange&gt;
          &lt;Event
              xmlns="urn:schemas-upnp-org:metadata-1-0/RCS/"&gt;
              &lt;InstanceID val="0"&gt;
                  &lt;Volume channel="Master" val="22"/&gt;
                  &lt;Volume channel="LF" val="100"/&gt;
                  &lt;Volume channel="RF" val="100"/&gt;
                  &lt;Mute channel="Master" val="0"/&gt;
                  &lt;Mute channel="LF" val="0"/&gt;
                  &lt;Mute channel="RF" val="0"/&gt;
                  &lt;Bass val="0"/&gt;
                  &lt;Treble val="0"/&gt;
                  &lt;Loudness channel="Master" val="1"/&gt;
                  &lt;OutputFixed val="0"/&gt;
                  &lt;HeadphoneConnected val="0"/&gt;
                  &lt;SpeakerSize val="5"/&gt;
                  &lt;SubGain val="0"/&gt;
                  &lt;SubCrossover val="0"/&gt;
                  &lt;SubPolarity val="0"/&gt;
                  &lt;SubEnabled val="1"/&gt;
                  &lt;SonarEnabled val="0"/&gt;
                  &lt;SonarCalibrationAvailable val="0"/&gt;
                  &lt;PresetNameList val="FactoryDefaults"/&gt;
              &lt;/InstanceID&gt;
          &lt;/Event&gt;
      &lt;/LastChange&gt;
  &lt;/e:property&gt;
  </code></pre>
  
  <p></p>
  
  <p>Thanks.</p>