Use Api to create Query Consulting and use DOMDocument

- Remove string with query, and use the DataAccess of Joomla! for more compatibilities in future and has more sense.
- Use DOMDocument to make html more fast and correctly.