I need to find a way to urlencode the values within xml tags but keeping the tags intact using PHP.
Maybe it's possible using an regular expression checking for begin tags and end tags with no tags within the element.
Or it might be better to look for data between > and </ without one of either within the data.
<?xml version="1.0"?>
<catalog>
<book>
<author>Gambardella, Matthew</author>
<title>XML Developer's Guide</title>
<genre>Computer</genre>
<price>44.95</price>
<publish_date>2000-10-01</publish_date>
<description>An in-depth look at creating applications with XML.</description>
</book>
<book>
<author>Ralls, Kim</author>
<title>Midnight Rain</title>
<genre>Fantasy</genre>
<price>5.95</price>
<publish_date>2000-12-16</publish_date>
<description>A former architect battles corporate zombies, an evil sorceress, and her own childhood to become queen of the world.</description>
</book>
</catalog>
Should become:
<?xml version="1.0"?>
<catalog>
<book>
<author>Gambardella%2C+Matthew</author>
<title>XML+Developer%27s+Guide</title>
<genre>Computer</genre>
<price>44.95</price>
<publish_date>2000-10-01</publish_date>
<description>An+in-depth+look+at+creating+applications+with+XML.</description>
</book>
<book>
<author>Ralls%2C+Kim</author>
<title>Midnight+Rain</title>
<genre>Fantasy</genre>
<price>5.95</price>
<publish_date>2000-12-16</publish_date>
<description>A+former+architect+battles+corporate+zombies%2C+an+evil+sorceress%2C+and+her+own+childhood+to+become+queen+of+the+world.</description>
</book>
</catalog>
EDIT In the end i changed the process, eliminating this problem.
Accepted the answer since i'd probably do the trick for other people