# ri > Mechanize::XmlFile

## [Mechanize::XmlFile](https://www.chedong.com/phpMan.php/perldoc/Mechanize%3A%3AXmlFile/markdown) < [Mechanize::File](https://www.chedong.com/phpMan.php/perldoc/Mechanize%3A%3AFile/markdown)

------------------------------------------------------------------------
## Extended by:
Forwardable (from /home/chedong/.local/share/rdoc)

(from /home/chedong/.local/share/rdoc)
------------------------------------------------------------------------
This class encapsulates an XML file. If Mechanize finds a content-type
of 'text/xml' or 'application/xml' this class will be instantiated and
returned. This class also opens up the search and at methods available
on the underlying [Nokogiri::XML::Document](https://www.chedong.com/phpMan.php/perldoc/Nokogiri%3A%3AXML%3A%3ADocument/markdown) object.

Example:

  require 'mechanize'

  agent = Mechanize.new
  xml = agent.get('<http://example.org/some-xml-file.xml>')
  xml.class #=> [Mechanize::XmlFile](https://www.chedong.com/phpMan.php/perldoc/Mechanize%3A%3AXmlFile/markdown)
  xml.search('//foo[@attr="bar"]/etc')
------------------------------------------------------------------------
## Class methods:

  new

## Instance methods:

  at
  search
  xml

## Attributes:

  attr_reader xml

