Nokogiri: to_s WITHOUT html surrounding's tags?

n = Nokogiri::HTML("<h1>H1</h1>")
n.to_s
# => <!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\"
\"http://www.w3.org/TR/REC-html40/loose.dtd\">\n<html><body><h1>H1</h1></body></html>

Is there a method that only outputs the stuff I've read, and not the
whole valid XHTML stuff?

Well, it's not XHTML, if you note the doctype :slight_smile: but ...

Needed output:
<h1>H1</h1>

n = Nokogiri::HTML("<h1>H1</h1>").xpath('//h1').to_xml

=> "<h1>H1</h1>"

I would think that'd be pretty apparent from a glance at the examples
in the rdoc, btw. Just sayin' :slight_smile: