Introducing the Svgle (SVG + Rexle) gem

require 'svgle'

s =<<SVG
<svg width="400" height="110">
  <g id="group1" fill="red">
    <line x1="0" y1="0" x2="200" y2="200" style="stroke:rgb(255,0,0);stroke-width:2" />

doc =
line = doc.root.element('g').element('line')
line.class #=> Svgle::Line

line.x1 #=> "0"
line.x1 = 44
line.x1 #=> "44"

Note: This gem is under development and is an experiment into how SVG elements can be represented as objects within a Document Object Model.