Example:
new XML(<x><a><q/></a><b/><c/></x>).children();
new XML(<x><a><q/></a><b/><c/></x>).elements();
Kind regards,
Aeonnex
As Jaromanda X pointed out:
text nodes are children but not elements ... i.e. children include all elements and text nodes ... elements won't include text nodes – Jaromanda X
So in the following example there is a difference between the elements() and children() method:
new XML(<x><a><q/></a><b/>abc<c/></x>).children()
/*
<a><q/></a>
<b/>
abc
<c/>
*/
new XML(<x><a><q/></a><b/>abc<c/></x>).elements()
/*
<a><q/></a>
<b/>
<c/>
*/