var xml = "<test> <tag> <t>\n</t> </tag> </test>"; document = new DOMParser().parseFromString(xml, "text/xml");