xml check before parsing as xml