Creating Factory function

Created Factory function - stared making the instance xml to create
objects