<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -17,10 +17,17 @@ class Wave
       @options      = options
       @annotations  = []
       raise Wave::WaveError, &quot;Document has no blip&quot; unless blip
-      @source       = blip.content
       blip.document = self
     end
 
+    def items
+      source.to_s.scan(/&lt;.*?&gt;|./).flatten
+    end
+
+    def source
+      blip.content
+    end
+
     def wavelet
       blip.wavelet
     end</diff>
      <filename>lib/wave/document.rb</filename>
    </modified>
    <modified>
      <diff>@@ -25,6 +25,25 @@ class DocumentTest &lt; Test::Unit::TestCase
   end
 
   context &quot;document parsing&quot; do
-    setup { @document = Factory.document }
+    setup {
+      @xml = &quot;&lt;xml&gt;&lt;p&gt;frist psot&lt;/p&gt;&lt;p&gt;great&lt;/p&gt;&lt;/xml&gt;&quot;
+      @document = Factory.document :blip =&gt; Factory.blip(
+                                              :content =&gt; @xml
+                                            )
+    }
+    should &quot;have xml source available via Document#source&quot; do
+      assert_equal @xml, @document.source
+    end
+    should &quot;properly count the number of items&quot; do
+      # &lt;xml&gt;&lt;p&gt;frist psot&lt;/p&gt;&lt;p&gt;great&lt;/p&gt;&lt;/xml&gt;
+      #   ^   ^ ^^^^^^^^^^  ^  ^ ^^^^^  ^    ^
+      assert_equal 21, @document.items.size
+    end
+    should &quot;have its items properly ordered&quot; do
+      # &lt;xml&gt;&lt;p&gt;frist psot&lt;/p&gt;&lt;p&gt;great&lt;/p&gt;&lt;/xml&gt;
+      #   ^   ^ ^^^^^^^^^^  ^  ^ ^^^^^  ^    ^
+      assert_equal &quot;&lt;p&gt;&quot;, @document.items[1]
+      assert_equal &quot;s&quot;,   @document.items[9]
+    end
   end
 end</diff>
      <filename>test/document_test.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>124da6ef7473db9a6b3178749e357c048f5aa28c</id>
    </parent>
  </parents>
  <author>
    <name>Jack Danger Canty</name>
    <email>gitcommit@6brand.com</email>
  </author>
  <url>http://github.com/JackDanger/wave/commit/ff8d988c1d03069cdb082041fd572dec03902464</url>
  <id>ff8d988c1d03069cdb082041fd572dec03902464</id>
  <committed-date>2009-06-02T22:57:03-07:00</committed-date>
  <authored-date>2009-06-02T22:57:03-07:00</authored-date>
  <message>testing the Document can parse XML</message>
  <tree>88d8afc1640c478405101b1930975bfeea942316</tree>
  <committer>
    <name>Jack Danger Canty</name>
    <email>gitcommit@6brand.com</email>
  </committer>
</commit>
