Saved search

Fixed xml generation and added specs.