I'm trying to parse a large XML file to put the contents in my database. My question is simple, although I find it difficult to find a nice and clean solution.
Imagine the following XML-string:
<tag1>
OuterText <tag2>InnerText</tag2>
</tag1>
Edit. The question is: How do I catch the OuterText in a string?
I could just remove tags of and the tags and content of using regex, but so far I've been using SimpleXML so I'd prefer an answer that goes nicely with this practice.