From http://stackoverflow.com/questions/15675352/regex-convert-xml-to-json

Working XML to JSON regex function in javascript