title: XML node vs. attribute in Scala?
body: <p><em>Remark: please consider XPath syntax dead here, thank you.</em></p>
  <p>I have xml node (HTML actually), and I would like to get an attribute of it.</p>
  <p>In C# (HTMLAgilityPack) I could get attribute object by name. For example having &quot;a&quot; node I could ask for &quot;href&quot; attribute.</p>
  <p>In Scala there is &quot;attribute&quot; method within xml.Node, but this returns a <strong>sequence</strong> of.. <strong>nodes</strong>. An attribute is a node? How it is possible to have several attributes with the same name? I am completely puzzled.</p>
  <p>Moreover there is xml.Attribute class but I don't see it used in xml.Node.</p>
  <p><em>I have PiS book but XML chapter is very shallow.</em></p>
  <h2>The question</h2>
  <p>How should I understand asking for an attribute an getting collection of nodes?</p>
  <p>IOW: what sense is in returning an <strong>option</strong> of <strong>collection</strong> of <strong>nodes</strong> instead of returning attribute?</p>
  <ul>
  <li>option -- if there is no attribute, collection should be empty, it is doubling semantics</li>
  <li>collection -- this implies there are multiple attribute possible, so I am curious in what scenario I get collection of size &gt; 1</li>
  <li>node -- attribute is pretty simply entity, why such overkill and suggesting that attribute can have tree structure</li>
  </ul>