Ram - 2011-10-17

Hi,
I am a new bee for ftl, I have surfing for a while to find a logic for couple of requirements that I have.
Can some one help me in giving a code snippet or reference or clues for the below requirements.

Q1: If I have the below input

<keys>a b</keys>
<values>1 2</values>

and expecting the output to be ->
<a>1</a>
<b>2</b>

What is equivalent code in ftl?

Q2: If I have a string "Hello World. This is my first FTL. User=Ram"
And then having 3 patterns
p1=(.+)(=)(.+)
p2=(.+)(;)(\w+)
p3=(.+)(-)(\d+)

Based on the pattern matches, I want to take different actions
I wrote a function like :

[#return "This is ${dn?groups}. Matching Pattern1"]

[#return "This is ${dn?groups}. Matching Pattern2"]

[#return "This is ${dn?groups}. Matching Pattern3"]

Is there a better way of handing this?

Finally the last question is :
In the input xml file I have different namespaces. How should I refer them in ftl?

Thanks in advance.
best regards,
Ramu