@ashish: reading the XHTML tags from a file is the definition of parsing. There's no other way to separate them than to parse the file to discover which elements are tags and which are text. You do _not_ want to try implementing this yourself because `NSXMLParser` is much better at handling poorly formed HTML than you are.