--- /dev/null
+use HTML::Zoom;
+use Test::More;
+
+my $zoom = HTML::Zoom->from_html(<<HTML);
+<form class="myform" action="/somewhere">
+<label />
+<input />
+</form>
+HTML
+
+my @fields = (
+ { id => "foo", label => "foo", name => "foo", type => "text", value => 0 },
+ { id => "bar", label => "bar", name => "bar", type => "radio", value => 1 },
+);
+
+my $h = $zoom->select('.myform')->repeat_content([
+ map { my $field = $_; sub {
+ $_->select('label')
+ ->add_attribute( for => $field->{id} )
+ ->then
+ ->replace_content( $field->{label} )
+ ->select('input')
+ ->add_attribute( name => $field->{name} )
+ ->then
+ ->add_attribute( type => $field->{type} )
+ ->then
+ ->add_attribute( value => $field->{value} )
+ } } @fields
+ ])->to_html;
+
+ok 1;
+done_testing;
--- /dev/null
+use strict;
+use HTML::Zoom;
+use Test::More;
+
+my $z = HTML::Zoom->from_html(<<HTML);
+<html>
+<body>
+<div id="foo"><p/></div>
+</body>
+</html>
+HTML
+
+my @list = qw(foo bar baz);
+my $iter = sub { shift @list };
+
+$z->select("#foo")->repeat(sub {
+ my $e = $iter->() or return;
+ return sub { $_->select("p")->replace_content($e) };
+})->to_html;
+
+ok 1;
+
+done_testing;
--- /dev/null
+use HTML::Zoom;
+use Test::More tests => 1;
+
+my $zoom = HTML::Zoom->from_html('<p>Hello my name is <span id="name" /></p>');
+my $html = $zoom->select('#name')->replace_content('Foo foo')->to_html;
+is($html, '<p>Hello my name is <span id="#name">Foo foo</span>');