# \[libxml\] NoMethodError for XML::Node::Set

**URL:** <https://www.ruby-forum.com/t/libxml-nomethoderror-for-xml-set/86306>\
**Category:** Ruby\
**Created:** [February 21, 2007, 10:36am UTC](https://www.ruby-forum.com/t/libxml-nomethoderror-for-xml-set/86306 "2007-02-21T10:36:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bastien-vaucher](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/ed655f/32.png) [@bastien-vaucher](https://www.ruby-forum.com/u/bastien-vaucher)\
**Post date:** [February 21, 2007, 10:36am UTC](https://www.ruby-forum.com/t/libxml-nomethoderror-for-xml-set/86306/1 "2007-02-21T10:36:13Z")

</div>

I just began using libxml and I wanted to find the “body” tag in a xhtml  
file, so i tried this :

doc = XML::Document.file(@file)  
root = doc.root  
nodeset = @root.find(“body”)  
node = nodeset.first

but when I execute the code I get this error message :

NoMethodError: undefined method `first’ for #XML::Node::Set:0x330c624

?!?  
Does someone know where this could come from ? And how to make sure it’s  
installed correctly ?  
To install it I used darwinport and when I look at the installed  
librairies, I see that :  
…  
libiconv @1.11\_4+darwin\_8 (active)  
libxml @1.8.17\_0 (active)  
libxml2 @2.6.27\_0 (active)  
rb-libxml2 @0.3.6\_0 (active)  
rb-rubygems @0.9.1\_0 (active)  
ruby @1.8.5-p12\_0 (active)  
zlib @1.2.3\_0 (active)  
…

Thanks for your help
