PIXSAR is an algorithm that is capable of efficiently rearranging an XML-based database. It does so by treating database clustering as an augmented tree partitioning problem and adjusting the data physical layout according to the dynamic workload. iPIXSAR, an extension, is able to do so in the presence of multiple-indexes over the database.