To not to ignore whitespace nodes prior to parsing
package{ import flash.display.Sprite; public class Main extends Sprite{ public function Main(){ XML.ignoreWhitespace = false; // Don't ignore whitespace nodes var x1:XML = <a><b></b></a>; var x2:XML = <a> <b></b> </a>; trace(x1 == x2); // Now displays: false } } }