querying functionality (sql -> xml -> php)