<div>šI parse them to list of elements:</div><div>datatype myXml =<br />ššš Text of string<br />ššš | Open of string * list { N : string, V : string } * option string<br />ššš | Close of string<br />ššš | Other<br /><br /></div><div>I've attached related modules, but the main problem is that I don't want to write full XML parser (dealing with entities, for example). Current code does not cover all cases (it is dirty and seems to have a silly bugs even with escaping; I have used it for two test files only for work with UI part). Probably, it is better do not invest time to optimization...</div><div>12.10.2012, 16:53, "Adam Chlipala" <adamc@csail.mit.edu>:</div><blockquote type="cite"><br /> OK, then I'd expect to parse fragments into a simple tree datatype.<br /> <br /> Maybe if you point us to an example of your parsing code, I can give some advice on making it faster.š (Linear-time/space parsing of strings in pure Ur code should be pretty easy, if you use the right standard library functions.)<br /> </blockquote>