dam5s/happymapper — pull request #15 by zrob (2012-09-25 21:12:00+00:00)
Title: add wrap definition

You may want to map the sub-elements contained buried in a tag as top level item. Xpath filtering lets you parse it, but it won't respect that tag when doing to_xml on the doc.

This uses 'wrap' function to allow a level in the doc hierarchy to be transparent to the ruby doc but still exist in xml when parsing and printing in to_xml

```xml

myname

some description

12345

```
```ruby
class Root
include HappyMapper
tag 'root'
attribute :attr1, String
element :name, String
wrap 'mywraptag' do
element :description, String
end
element :number, Integer
end

root = Root.new(xml)
root.description = 'a new description'
```