How to read a string containing xml elements without using the XML properties
<p>Im doing an xml reading process in my project. Where i have to read the contents of an Xml file. I have achieved it.</p>

<p>Just out of curiosity i also  tried using the same by keeping the xml content inside the a string and then read only the values inside the elemet tag. Even this i have achieved. The below is my code.</p>

<pre><code>string xml = &lt;Login-Form&gt;

&lt;User-Authentication&gt;

&lt;username&gt; Vikneshwar &lt;/username&gt;

&lt;password&gt; xxx &lt;/password&gt;

&lt;/User-Authentication&gt;

&lt;User-Info&gt;

&lt;firstname&gt; Vikneshwar &lt;/firstname&gt;

&lt;lastname&gt; S &lt;/lastname&gt;

&lt;email&gt; xxx@xxx.com &lt;/email&gt;

&lt;/User-Info&gt;

&lt;/Login-Form&gt;";
        XDocument document = XDocument.Parse(xml);

        var block = from file in document.Descendants("client-authentication")
                    select new
                    {
                        Username = file.Element("username").Value,
                        passWord = file.Element("password").Value,
                    };

        foreach (var file in block)
        {
            Console.WriteLine(file.Username);
            Console.WriteLine(file.passWord);
        }
</code></pre>

<p>similarly i obtained my other set of elements(firstname,lastname,email).</p>

<p>Now my curiosity draws me again. Now im thinking of the doing the same using the string functions?</p>

<p>The same string used in the above code is to be taken.</p>

<p>Im trying not to use any XMl related classes ie xdocument,xmlreader etc.</p>

<p>The same output should be achieved using only string functions. Im not able to do that. Is it possible.</p>

<p>Any guidance will be apprecaited.</p>

<p>Thanks and regards.</p>

<p>S. Vikneshwar.</p>
