Question: I'm trying to create a small app that takes a base text template with specially tagged word arrays, parses the template contents and outputs a randomly generated text document.

Essentially, what I'm trying to do is take this:

<{Hello|Hi|Howdy}> world.

and turn it into this:

```

 Hello world.
OR
 Hi world.
OR
 Howdy world.

```

So far, so good. Googling got me enough to be able to successfully extract the inner text between the <{ and }> into an array, from which I then randomly select a word to replace the full <{Hello|Hi|Howdy}>.

The problem I'm having is parsing a nested set of words wrapped in the same tags.

For example, if I start with this:

<{Hello|Hi|Howdy}> world. <{How's <{life|it going}>?|How are you?}>

I'd like to turn it into this:

```

 Hello world. How's life?
OR
 Hello world. How's it going?
OR
 Hello world. How are you?

```

and so on...

Could someone suggest a way to do this fairly simply using c# and regex?

I've looked at <http://www.vsj.co.uk/articles/display.asp?id=789> and <http://www.m-8.dk/resources/RegEx-balancing-group.aspx>, and to be honest, a lot of that goes way over my head, so something simple would be nice. ;-)

Thank you.

Answer: 
Jens-Martin is correct. If you're using the client generated by Axis wsdl2java, all the validation you need is happening behind the scenes. There are two kinds of validation going on:

1. SOAP has a schema definition, and the response must be a valid SOAP response or the client will throw an exception.
2. The WSDL you used to generate the client described what goes in the SOAP envelope of the response. If the response you get doesn't match, the client will throw an exception.

If you really feel compelled to write your own XML parser/validator and SOAP handler, you're on your own.
Try [SOAPUI](http://www.soapui.org/). It is quite a powerful open source testing tool for web services. You can construct test suites, do performance testing, and specify customized validation criteria.