switching strategy to two pass processing, currently outputting xml, but normalized and easier to parse into JavaScript