# Rexml Quoting control

**URL:** <https://www.ruby-forum.com/t/rexml-quoting-control/160122>\
**Category:** Ruby\
**Created:** [February 11, 2009, 11:04pm UTC](https://www.ruby-forum.com/t/rexml-quoting-control/160122 "2009-02-11T23:04:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![pitosalas](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a4c791/32.png) [@pitosalas](https://www.ruby-forum.com/u/pitosalas)\
**Post date:** [February 11, 2009, 11:04pm UTC](https://www.ruby-forum.com/t/rexml-quoting-control/160122/1 "2009-02-11T23:04:10Z")

</div>

I’m generating a xml with Rexml. Pretty straightforward. I have a  
question about quoting.

I would like this result (for example)

But when I do the obvious:

> > x = Element.new(“Outline”)  
> > x.add\_attribute(“text”, “Ellen’s house”)  
> > x.add\_attribute(“Url”, “[http://www.google.com](http://www.google.com)”)

> > x  
> > =\>

Note the quoting is using single quotes and & escapes. What I showed at  
the top is also valid xml. How do I ask rexml to generate it?

If you know and can help it would be greatly appreciated!
