Create Post Types from a XML url (Real Estate website)

I would definitely recommend the Custom Post Type route. You will have two issues:

  1. How to automatically add new properties when the XML is updated.
  2. How to update existing property values if they change (e.g., House A has a price increase after the initial import).

To solve the first, you can set up a WordPress cron that will hook into your import action. Read more on the WP Cron – it does not run like a traditional server-based cron so it may not match your needs.

For the second issue of updating data, there are several ways to do this. One way would be to save a hashed version of the data that is being imported. For example, if your XML looks like this for House A:

<property>
    <title>House A</title>
    <price>$100</price>
    <bedrooms>3</bedrooms>
    <bathrooms>2.5</bathrooms>
</property>

You can take that whole string and pass it through a hash function like wp_hash which would give you something like this: f0605d40e0d52c56803be67d4f08742a (not exactly this, this is just MD5).

Then, if your data changes (price goes up to $200, for example), during the import process you can hash again and double-check if the hash matches the existing property. If I use the same process to hash the data at $200, we get this: 67929e91190420a69ac258f78b6f1777. If your script detects a difference, then re-import that property.

You will need to be able to match properties another way, however. My recommendation would be to create a slug out of the property title or match it via some sort of ID based on the XML side. If each property has an ID from the XML, save it as custom meta in the property post and match those.

One last thing to look into: If you would rather not deal with code, you may be able to use a tool like WPAllImport, which allows you to set up custom feeds for XML and other sources.

Hope all this helps!