I have code something like this :
<?xml version="1.0" encoding="UTF-8"?>
<Personlist xmlns="http://example.org">
    <Person>
        <Name>Louis</Name>
        <Address>
            <StreetAddress>Somestreet</StreetAddress>
            <PostalCode>00001</PostalCode>
            <CountryName>Finland</CountryName>
        </Address>
    </Person>
    <Person>
        <Name>Rakshith</Name>
        <Address>
            <StreetAddress>Somestreet</StreetAddress>
            <PostalCode>00001</PostalCode>
            <CountryName>Finland</CountryName>
        </Address>
    </Person>
    <Person>
        <Name>Steve</Name>
        <Address>
            <StreetAddress>Someotherstreet</StreetAddress>
            <PostalCode>43400</PostalCode>
            <CountryName>Sweden</CountryName>
        </Address>
     </Person>
 </Personlist>
How to to stop looping if name 'Rakshith' found in xml dom parsing. And in simple xml parser we can directly access the nth element like $xml->Person[0]->Name. But in XML dom, we need to parse in foreach itself so far i know. Is there any way like this that would suit my requirement.
Thanks in advance
